14.11.2009, 16:39
pawn Код:
if(strcmp(cmd, "/sethp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /sethp [playerid/PartOfName] [health]");
return 1;
}
new playa;
new health;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
health = strval(tmp);
if (IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
new string[256];
SetPlayerHealth(playa, health);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "AdmWarning: %s has set %s's hp to %d.", sendername,giveplayer,health);
SendClientMessageToAll(COLOR_GREY,string);
}
}
}
}
return 1;
}