26.07.2012, 17:02
pawn Code:
CMD:setplayerhealth(playerid,params[])
{
new gid;
if(sscanf(params,"u",gid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE:/setplayerhealth [PlayerID]");
if(!IsPlayerConnected(gid)) return SendClientMessage(playerid, COLOR_WHITE,"Player ID given is not connected.");
new Float:rand = random(100);
SetPlayerHealth(gid, rand);
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(gid, name, MAX_PLAYER_NAME);
format(str, 128, "You have set %s's health to %f", name, rand);
return SendClientMessage(playerid, COLOR_WHITE, str);
}