03.05.2011, 15:52
I need help with this
i probably did something wrong with this >_<
i probably did something wrong with this >_<
pawn Код:
dcmd_akill(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] > 3)
{
new string[100];
format(string, sizeof(string), "You must be administrator level 3 to use that command!");
return SendClientMessage(playerid, COLOR_ORANGE, string);
}
else if(!strlen(params))
return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /akill [id | name]");
else
{
new pName;
new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
if(IsPlayerConnected(id) && id != playerid)
{
SetPlayerHealth(id, 0.0);
new string[128];
format(string, sizeof(string), "You have been admin-killed by administrator %s", pName);
SendClientMessage(id, COLOR_ORANGE, string);
format(string, sizeof(string), "You have successfully admin-killed player %s", pName);
return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else
return SendClientMessage(playerid, COLOR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
}
}