Command used? - 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: Command used? (
/showthread.php?tid=358182)
Command used? -
Squirrel - 09.07.2012
I need something that will help out with commands.
for example
"You have used this command already"
PHP код:
if(!strcmp(cmdtext, "/heal", true, 4))
{
SetPlayerHealth(playerid, 100);
return 1;
}
I need like "Error: You used this command". This would reset onplayerdeath, so when he dies he can use the cmd again
Re: Command used? -
coole210 - 09.07.2012
pawn Код:
//Top of script:
new bool:UsedHeal[MAX_PLAYERS] = false;
//OnPlayerDeath:
UsedHeal[playerid] = false;
//In command:
//Before SetPlayerHealth
if(UsedHeal[playerid]) return SendClientMessage( Here you should send a message saying they can't heal yet );
//After SetPlayerHealth
UsedHeal[playerid] = true;
Re: Command used? -
[A]ndrei - 09.07.2012
coole210 why do all that
![Huh?](images/smilies/confused.gif)
like this WITHOUT ALL OF THAT
pawn Код:
if(!strcmp(cmdtext, "/heal", true, 10) == 0)
{
SetPlayerHealth(playerid, 100);
return 1;
}
Re: Command used? -
tyler12 - 09.07.2012
Quote:
Originally Posted by [A]ndrei
coole210 why do all that ![Huh?](images/smilies/confused.gif)
like this WITHOUT ALL OF THAT
pawn Код:
if(!strcmp(cmdtext, "/heal", true, 10) == 0) { SetPlayerHealth(playerid, 100); return 1; }
|
are you troling or very stupid?
Re: Command used? -
Squirrel - 10.07.2012
Thanks!