SA-MP Forums Archive
Cmd work in 5 secs? - 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)
+--- Thread: Cmd work in 5 secs? (/showthread.php?tid=394915)



Cmd work in 5 secs? - Louris - 24.11.2012

I want to make that when player write /exit, cmd works in ~5 secs, this is possible? Because someone doing /dm, when he get low hp, he /exit and already /dm and he get full HP.

COMMAND:exit( playerid, params[ ] )
{
if(DM[playerid] == true)
{
SetPlayerPos(playerid, 397.5430, -1804.3560, 8.9000);
SendClientMessage(playerid, 0xFF000090, "You exit from DM zone.");
ResetPlayerWeapons(playerid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
DM[playerid] = false;
}


Re: Cmd work in 5 secs? - YoYo123 - 24.11.2012

https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx


Re: Cmd work in 5 secs? - Louris - 24.11.2012

UP, please help.


Re: Cmd work in 5 secs? - YoYo123 - 24.11.2012

http://lmgtfy.com/?q=samp+timer+tutorial


Re: Cmd work in 5 secs? - ItalianKiller1568 - 24.11.2012

On Top of your script :

Код:
new ExitTimer[MAX_PLAYERS];
Код:
COMMAND:exit( playerid, params[ ] )
{
if(DM[playerid] == true)
{
SetPlayerPos(playerid, 397.5430, -1804.3560, 8.9000);
SendClientMessage(playerid, 0xFF000090, "You exit from DM zone.");
ResetPlayerWeapons(playerid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
DM[playerid] = false;
SetTimerEx("ExitTimer", 5000, false);
}
I think this will help you


Re: Cmd work in 5 secs? - Louris - 24.11.2012

Italian doesnt work, i get warnings.. I think this script can't work.


Re: Cmd work in 5 secs? - Boooth - 24.11.2012

Louris, the issue is you don't understand where you are meant to put the code, so even if I wrote you out the command you probably would still receive errors.

You need to read up on Timer tutorials and it should help you understand.

This should help:
https://sampwiki.blast.hk/wiki/SetTimerEx