27.03.2011, 19:34
when i akill my self it shows the player that is id0 killed me for example imagine im id1 name:tanush and id0 name:killa. it will show Killa has admin killed you when i did /akill 1
pawn Код:
COMMAND:akill(playerid, params[])
{
if(PlayerData[playerid][AdminLevel] > 1)
{
new id,str[128],name[MAX_PLAYER_NAME],oname[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
GetPlayerName(id,oname,sizeof(oname));
if(sscanf(params, "ui", id)) return SendClientMessage(playerid, 0xFF9900AA, "USAGE: /akill [id]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "That user is not connected.");
format(str,sizeof(str),"Administrator %s has admin killed you!",oname);
SendClientMessage(id,0xFF9900AA,str);
format(str,sizeof(str),"You had admin killed %s!",oname);
SendClientMessage(playerid,0xFF9900AA,str);
return SetPlayerHealth(id,0);
}
else return SendClientMessage(playerid,0xFF0000FF, "ERROR: Your admin level isn't high enough!");
}