Healup
#5

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
The upper guy is still wrong by the way. Try this one
Код:
CMD:healup(playerid, params[])
{
    new victim,Float:health;
    if(PlayerInfo[playerid][pFaction] != 3) return SCM(playerid, COLOR_LIGHTRED, "You are not a police officer.");
    if(sscanf(params, "u", victim)) return SendClientMessage(playerid, COLOR_GREY, "/healup (id)");
    if(victim == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_LIGHTRED, "That player is not connected.");

     if (GetDistanceBetweenPlayers(playerid,victim) < 5)
    {
    GetPlayerHealth(victim, health);
    if (health < 40)
     SetPlayerHealth(victim, 60);
    }
    else return SCM(playerid, COLOR_LIGHTRED, "You're not close to that player.");
      return 1;
}
The problem was that you were using wrong sscanf parameters, " u " is for getting player id , but you also have " d " which is for a number, but because you don't need it so i removed, and the second problem was that health should've to be a float, and you were using Float, y , z for no reason, now it'll works fine..
Thank-a-YOU. Works perfect now +Rep'd
Reply


Messages In This Thread
Healup - by Cubie - 10.09.2017, 16:22
Re: Healup - by silverms - 10.09.2017, 17:06
Re: Healup - by silverms - 10.09.2017, 17:08
Re: Healup - by FuNkYTheGreat - 10.09.2017, 17:16
Re: Healup - by Cubie - 10.09.2017, 17:28

Forum Jump:


Users browsing this thread: 1 Guest(s)