SA-MP Forums Archive
Delay between sendclientmessage - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Delay between sendclientmessage (/showthread.php?tid=264533)



Delay between sendclientmessage - svorpyx - 26.06.2011

Hello,

I've got a command to check the version with updates, It's like this:

Код:
if (strcmp("/version", cmdtext, true, 10) == 0)
{
 	SendClientMessage(playerid, 0xBE1600FF,"Version 0.001a");
(delay here)
 	SendClientMessage(playerid, 0xFF8000FF,"Updates:");
 	SendClientMessage(playerid, 0xFF8000FF,"Added Register/Login Dialog system with MySQL");
	return 1;
}
Now I want a delay between the first SendClientMessage and the 2nd.

Can someone please help me?


Re: Delay between sendclientmessage - King Ace - 26.06.2011

You need to use timer.


Re: Delay between sendclientmessage - iPLEOMAX - 26.06.2011

pawn Код:
//In OnPlayerCommandText
if (strcmp("/version", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, 0xBE1600FF,"Version 0.001a");
    SetTimerEx("DelayedMsg", 3000, false, "d", playerid);
    return 1;
}

//At the end of your script. NOT inside any function.
forward DelayedMsg(playerid);
public DelayedMsg(playerid)
{
    SendClientMessage(playerid, 0xFF8000FF,"Updates:");
    SendClientMessage(playerid, 0xFF8000FF,"Added Register/Login Dialog system with MySQL");
    return true;
}
Untested.

And you can learn to use Timers from SAMP Wiki: SetTimerEx


Re: Delay between sendclientmessage - svorpyx - 26.06.2011

Is this the only possible way?


Re: Delay between sendclientmessage - iPLEOMAX - 26.06.2011

Quote:
Originally Posted by svorpyx
Посмотреть сообщение
Is this the only possible way?
Yez.


Re: Delay between sendclientmessage - =WoR=Varth - 27.06.2011

There's y_timer to make it easier.

EDIT: Gone


Re: Delay between sendclientmessage - Donya - 27.06.2011

varthshenon... you should remove it..

less people getting it, less complaints on this board saying that there server froze..

there are times when it can actually freeze your server forever, instead of freezing it for the time you set..


Re: Delay between sendclientmessage - =WoR=Varth - 27.06.2011

Okay, just use y_timer.
https://sampforum.blast.hk/showthread.php?tid=182948