• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Functions iPrintLnBold()
#1
Help please with the function.

Example:
iPrintLnBold(null, "^5iprintlnbold test!");

What can I do to show the text on the screen for 5 seconds?
  Reply
#2
You can't
Or you call it twice or something and wait a few seconds between the 2, but you can't change the time of the message
  Reply
#3
iPrintLnBold("^5iprintlnbold test!", null);
Thread.sleep(1000);
iPrintLnBold("^5iprintlnbold test!", null);
Thread.sleep(1000);
iPrintLnBold("^5iprintlnbold test!", null);
Thread.sleep(1000);
iPrintLnBold("^5iprintlnbold test!", null);
Thread.sleep(1000);
iPrintLnBold("^5iprintlnbold test!", null);

but its best practice to only use sleeps in seperate threads!
(XS4ALL/GoT2DayZ) DayZ Servers (http://got2dayz.nl)
[Image: b_350_20_2E3226_383F2D_D2E1B5_5A6C3E.png]
[Image: b_350_20_2E3226_383F2D_D2E1B5_5A6C3E.png]
[Image: b_350_20_2E3226_383F2D_D2E1B5_5A6C3E.png]
http://fb.me/GoT2DayZ
  Reply
#4
Thank you for your answers
  Reply
#5
@pieter If you're gonna do it, at least do it right Troll

CSHARP Code
  1. void thread(object arg)
  2. {
  3. object[] args = (object[])arg;
  4. string msg = (string)args[0];
  5. ServerClient client = (ServerClient)args[1];
  6. int seconds = (int)args[2];
  7.  
  8. int currsec = 0;
  9. while (currsec != seconds)
  10. {
  11. currsec++;
  12. Owner.iPrintLnBold(msg, client);
  13. Thread.Sleep(1000);
  14. }
  15. }
  16.  
  17. void ShowMessage(string msg, ServerClient client, int seconds)
  18. {
  19. object[] args = { msg, client, seconds };
  20. ThreadPool.QueueUserWorkItem(new WaitCallback(thread), args);
  21. }
[-] The following 1 user says Thank You to JariZ for this post:
  • [Z00MBY] Alex
  Reply
#6
thank you JariZ!!!!
[-] The following 1 user says Thank You to [Z00MBY] Alex for this post:
  • JariZ
  Reply
#7
@litgar Remove the 'Owner.' part before iPrintLnBold (line 12), forgot that only RollTheDice uses Owner
  Reply
#8
(04-16-2012, 08:42)JariZ Wrote: @litgar Remove the 'Owner.' part before iPrintLnBold (line 12), forgot that only RollTheDice uses Owner

ok! Smile
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Release] Matrix Functions Yamato 1 1,180 07-29-2013, 20:14
Last Post: Rendflex
  [Release] nCr and Factorial Functions Yamato 2 1,139 06-18-2013, 17:24
Last Post: Nekochan
  [Release] Random Functions 1.1 Yamato 22 5,541 04-20-2013, 10:13
Last Post: Dominator56
  Help iPrintLnBold HELP! XxBRxX 3 1,358 12-04-2012, 10:33
Last Post: JariZ
  Functions surtek 14 5,898 09-19-2012, 07:57
Last Post: Pozzuh
Information [Solved] Info about functions, events and etc. Nerus 2 1,139 09-09-2012, 20:57
Last Post: surtek
  Seldom required functions Phl3x_ 3 1,453 06-03-2012, 10:53
Last Post: RaZ
  Help I find This functions and i need your help. Bloodfocus 5 1,850 04-23-2012, 01:43
Last Post: House
  [Release] Array functions master131 4 1,654 09-17-2011, 14:23
Last Post: AZUMIKKEL
  [Release] Random Functions Yamato 12 3,383 08-17-2011, 13:07
Last Post: Nekochan

Forum Jump:


Users browsing this thread: 1 Guest(s)