11.03.2012, 10:16
use this one:
pawn Код:
dcmd_slap(playerid,params[]) {
if(IsPlayerCommandLevel(playerid,"slap")) {
if(!strlen(params)) return SendClientMessage(playerid,red,"Syntax Error: \"* Faisal_khan slaps <NICK OR ID> around a bit with a large trout.\".");
new id; if(!IsNumeric(params)) id = ReturnPlayerID(params); else id = strval(params);
if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid) {
SendCommandMessageToAdmins(playerid,"SLAP");
new string[256],name[24],ActionName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24);
format(string,256,"Administrator \"%s\" has bitch-slapped \"%s\".",name,ActionName); SendClientMessageToAll(yellow,string);
new Float:Health; GetPlayerHealth(id,Health); return SetPlayerHealth(id,Health-Config[SlapDecrement]);
} else return SendClientMessage(playerid,red,"ERROR: You can not slap yourself or a disconnected player.");
} else return SendLevelErrorMessage(playerid,"slap");
}