setplayerhealth
#5

PHP код:
if(strcmp(cmd"/sethp"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_WHITE"USAGE: /sethp [playerid/PartOfName] [health]");
                return 
1;
            }
            new 
playa;
            new 
health;
            
playa ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_WHITE"USAGE: /sethp [playerid/PartOfName] [health]");
                return 
1;
            }
            
health strvalEx(tmp);
            if(
PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(
IsPlayerConnected(playa))
                {
                    if(
playa != INVALID_PLAYER_ID)
                    {
                        if(
PlayerInfo[playa][pAdmin] > PlayerInfo[playerid][pAdmin] && health == 0)
                        {
                            
format(stringsizeof(string), "{AA3333}AdmCmd{FFFF00}: %s was killed, reason: Attempting to set a higher admin's health to 0."PlayerName(playerid));
                            
ABroadCast(COLOR_LIGHTREDstring1);
                            
SetPlayerHealth(playerid,0);
                            return 
1;
                        }
                        
SetPlayerHealth(playahealth);
                        
format(stringsizeof(string), "   You have set %s's health to %d !",PlayerName(playa),health);
                        
SendClientMessage(playeridCOLOR_GREYstring);
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   You are not authorized to use that command !");
            }
        }
        return 
1;
    } 
Use this cmd for help ppl
Reply


Messages In This Thread
setplayerhealth - by ArcNuke - 31.05.2015, 11:45
Re: setplayerhealth - by J0sh... - 31.05.2015, 11:46
Re: setplayerhealth - by amirm3hdi - 31.05.2015, 11:47
Re: setplayerhealth - by Konstantinos - 31.05.2015, 11:55
Re: setplayerhealth - by SoFahim - 31.05.2015, 13:15
Re: setplayerhealth - by J0sh... - 31.05.2015, 13:27
Re: setplayerhealth - by SoFahim - 31.05.2015, 15:33
Re: setplayerhealth - by bgedition - 31.05.2015, 15:38
Re: setplayerhealth - by Konstantinos - 31.05.2015, 15:42
Re: setplayerhealth - by bgedition - 31.05.2015, 15:44

Forum Jump:


Users browsing this thread: 3 Guest(s)