Command for specific score+ - 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 for specific score+ (
/showthread.php?tid=590247)
Command for specific score+ -
xTURBOx - 27.09.2015
I want to know how to make a command for specific score+
example:
command is /healme and i want players with 100+ score to use it
Thanks in advance
Re: Command for specific score+ -
ironmen - 27.09.2015
Код:
CMD:healme(playerid, params[])
{
if(GetPlayerScore(playerid) <= 100)
{
SetHealth(playerid, 100);
}
return 1;
}
Re: Command for specific score+ -
ChandraLouis - 27.09.2015
Here you go.
pawn Код:
CMD:healme(playerid, params[])
{
if(GetPlayerScore(playerid) <= 100) // If the player's score is lower than 100, then they can't use this command.
{
SetPlayerHealth(playerid, 100); // You can change 100 to any health that you want.
}
return 1;
}
Re: Command for specific score+ -
ironmen - 27.09.2015
ChandraLouis That's just like the one i did!
Re: Command for specific score+ -
X337 - 27.09.2015
Quote:
Originally Posted by xTURBOx
command is /healme and i want players with 100+ score to use it
|
Код:
CMD:healme(playerid, params[])
{
if(GetPlayerScore(playerid) >= 100) // If the player's score is greater than 100, then they can't use this command.
{
SetPlayerHealth(playerid, 100); // You can change 100 to any health that you want.
}
return 1;
}
Re: Command for specific score+ -
xTURBOx - 27.09.2015
Quote:
Originally Posted by ChandraLouis
Here you go.
pawn Код:
CMD:healme(playerid, params[]) { if(GetPlayerScore(playerid) <= 100) // If the player's score is lower than 100, then they can't use this command. { SetPlayerHealth(playerid, 100); // You can change 100 to any health that you want. } return 1; }
|
Quote:
Originally Posted by X337
Код:
CMD:healme(playerid, params[])
{
if(GetPlayerScore(playerid) >= 100) // If the player's score is greater than 100, then they can't use this command.
{
SetPlayerHealth(playerid, 100); // You can change 100 to any health that you want.
}
return 1;
}
|
Firstly thanks for your support
Secondly i want to know why X337's code has >= 100, while ChandraLouis and Ironmen's code have <= 100 and which is the correct way?
Re: Command for specific score+ -
CalvinC - 27.09.2015
X337's code is correct, the others only allows the player to heal if he has 100 or less score.
Re: Command for specific score+ -
J0sh... - 27.09.2015
< Less than
<= Less than or equal to
> bigger than
>= bigger than or equal to