Command for specific score+
#1

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
Reply
#2

Код:
CMD:healme(playerid, params[])
{
          if(GetPlayerScore(playerid) <= 100)
          {
              SetHealth(playerid, 100);
           }
return 1;
}
Reply
#3

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;
}
Reply
#4

ChandraLouis That's just like the one i did!
Reply
#5

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;
}
Reply
#6

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?
Reply
#7

X337's code is correct, the others only allows the player to heal if he has 100 or less score.
Reply
#8

< Less than
<= Less than or equal to

> bigger than
>= bigger than or equal to
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)