just an issue with a sethp cmd
#5

PHP код:
CMD:sethp(playeridparams[]) 

    new 
amount,
        
target,
        
str128 ]; 
    if(
connected[playerid]) return GameTextForPlayer(playerid"~r~Spawn First"50005); 
    if(
pInfo[playerid][Admin] < 2) return SendClientMessage(playerid, -1"{C3C3C3}(INFO) You don't have the priviliges to use this command."); 
    if(
target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1"{c3c3c3}(INFO) The player is not connected!"); 
    if(
sscanf(params"ui"targetamount)) return SendClientMessage(playerid, -1"{c3c3c3}(INFO) /sethp [id] [amount]"); 
   
    
format(strsizeof(str), "{EFB509}(INFO) You have set %s's health to %d"PlayerName[playerid], amount); 
    
SendClientMessage(playerid, -1str); 
   
    
format(strsizeof(str), "{EFB509}(INFO) An admin has set your health to %d"amount); 
    
SendClientMessage(target, -1str); 

    
printf("Target: %i"target);
    
printf("Playerid: %i"playerid);
   
    
SetPlayerHealth(targetamount); 
    
format(str,sizeof(str), "{0066ff}(admin) %s has set player's %s HP to %d"PlayerName[playerid], PlayerName[target], amount); 
    
SendMessageToAdmins(str); 
    return 
1

I just edited your code, honestly.

Give it a try nonetheless.
Reply


Messages In This Thread
just an issue with a sethp cmd - by wallen - 13.03.2018, 19:21
Re: just an issue with a sethp cmd - by AdamsLT - 13.03.2018, 19:27
Re: just an issue with a sethp cmd - by wallen - 13.03.2018, 19:34
Re: just an issue with a sethp cmd - by AdamsLT - 13.03.2018, 19:45
Re: just an issue with a sethp cmd - by ISmokezU - 13.03.2018, 21:37

Forum Jump:


Users browsing this thread: 1 Guest(s)