SA-MP Forums Archive
A question, Whats the command for.... - 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: A question, Whats the command for.... (/showthread.php?tid=147246)



A question, Whats the command for.... - Apply - 11.05.2010

How do I do a command that can be used only once untill ur dead and then u can use it again after you spawn?
Thanks


Re: A question, Whats the command for.... - coole210 - 11.05.2010

make a variable at the TOP of your script (after includes)

Ex:

Код:
new WaitDeath[MAX_PLAYERS];
Then put this under the command:

Код:
if(WaitDeath[playerid] == 1)
{
SendClientMessage(playerid,COLOR,"You need to wait until you die to use this command again");
return 1;
}
Then at the end of the functions in the command put

Код:
WaitDeath[playerid] = 1;
Then at OnPlayerSpawn put

Код:
WaitDeath[playerid] = 0;



Re: A question, Whats the command for.... - Apply - 11.05.2010

Thanks man, I got it!


Re: A question, Whats the command for.... - coole210 - 11.05.2010

no problem glad to help