PDA

View Full Version : Cmd work in 5 secs?


Louris
24/11/2012, 03:44 PM
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;
}

YoYo123
24/11/2012, 03:46 PM
http://wiki.sa-mp.com/wiki/SetTimer
http://wiki.sa-mp.com/wiki/SetTimerEx

Louris
24/11/2012, 04:44 PM
UP, please help.

YoYo123
24/11/2012, 04:49 PM
http://lmgtfy.com/?q=samp+timer+tutorial

ItalianKiller1568
24/11/2012, 04:49 PM
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

Louris
24/11/2012, 04:57 PM
Italian doesnt work, i get warnings.. I think this script can't work.

Boooth
24/11/2012, 05:08 PM
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:
http://wiki.sa-mp.com/wiki/SetTimerEx