Healup
#1

Trying to make a command where if the victim his health is >40 it sets it to 60 but its not working.
What am I doing wrong?
Thanks in advance.

PHP код:
CMD:healup(playeridparams[])
{
    new 
victimhealth;
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(victimXYZ);
    if(
PlayerInfo[playerid][pFaction] != 3) return SCM(playeridCOLOR_LIGHTRED"You are not a police officer.");
    if(
sscanf(params"ud"victim)) return SendClientMessage(playeridCOLOR_GREY"/healup (id)");
    if(
victim == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_LIGHTRED"That player is not connected.");
     if (
GetDistanceBetweenPlayers(playerid,victim) < 5)
    {
    
GetPlayerHealth(victimhealth);
    if (
health 40)
     
SetPlayerHealth(victim60);
    }
    else return 
SCM(playeridCOLOR_LIGHTRED"You're not close to that player.");
      return 
1;

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)