22.02.2015, 16:53
Try something like this:
pawn Код:
CMD:sethealth(playerid, params[])
{
new user, health
if(!IsAdminLevel(playerid, 1)) return ERROR(playerid, "You need a higher administrator level to use this command.");
if(!sscanf(params, "ui", user, health))
{
if(user != INVALID_PLAYER_ID)
{
SetPlayerHealth(user, health);
}
if(user == playerid)
{
AdmCmd(playerid, "You have successfully set your health to %.1f.", health);
}
else if
{
AdmCmd(playerid, "You have successfully set %s's health to %.1f.", GetName(user), health);
AdmCmd(playerid, "Administrator %s has set your health to %.1f.", GetName(playerid), health);
}
else return SendClientMessage(playerid, red, "That player is offline.");
}
else return SendClientMessage(playerid, white, "/sethealth [playerid] [amount]");
return 1;
CMDMessageToAdmins(playerid, "sethealth");
}