13.03.2018, 19:21
PHP код:
CMD:sethp(playerid, params[])
{
if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
if(pInfo[playerid][Admin] < 2) return SendClientMessage(playerid, -1, "{C3C3C3}(INFO) You don't have the priviliges to use this command.");
{
new amount, str[128], target;
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) The player is not connectdd!");
if(sscanf(params, "ui", target, amount)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /sethp [id] [amount]");
format(str, sizeof(str), "{EFB509}(INFO) You have set %s's health to %d", PlayerName[playerid], amount);
SendClientMessage(playerid, -1, str);
format(str, sizeof(str), "{EFB509}(INFO) An admin has set your health to %d", amount);
SendClientMessage(target, -1, str);
SetPlayerHealth(target, amount);
format(str,sizeof(str), "{0066ff}(admin) %s has set player's %s HP to %d", PlayerName[playerid], PlayerName[target], amount);
SendMessageToAdmins(str);
}
return 1;
}