Help please with the function.
Example:
iPrintLnBold(null, "^5iprintlnbold test!");
What can I do to show the text on the screen for 5 seconds?
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
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!
Thank you for your answers
@pieter If you're gonna do it, at least do it right
CSHARP Code
void thread(object arg)
{
object[] args = (object[])arg;
string msg = (string)args[0];
ServerClient client = (ServerClient)args[1];
int seconds = (int)args[2];
int currsec = 0;
while (currsec != seconds)
{
currsec++;
Owner.iPrintLnBold(msg, client);
Thread.Sleep(1000);
}
}
void ShowMessage(string msg, ServerClient client, int seconds)
{
object[] args = { msg, client, seconds };
ThreadPool.
QueueUserWorkItem(new WaitCallback
(thread
), args
); }
@litgar Remove the 'Owner.' part before iPrintLnBold (line 12), forgot that only RollTheDice uses Owner
(04-16-2012, 08:42)JariZ Wrote: [ -> ]@litgar Remove the 'Owner.' part before iPrintLnBold (line 12), forgot that only RollTheDice uses Owner
ok!