14.03.2013, 03:25
pawn Код:
dcmd_slap(playerid,params[]) {
if(!IsPlayerCommandLevel(playerid,"slap")) return SendLevelErrorMessage(playerid,"slap");
if(!strlen(params)) return SendClientMessage(playerid,red,"Wrong Fromat: /SLAP <NICK OR ID>");
new id; if(!IsNumeric(params)) id = ReturnPlayerID(params); else id = strval(params);
if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid,red,"ERROR: You can not slap yourself or a disconnected player.");
new Float:Health, Float:X, Float:Y, Float:Z;
GetPlayerHealth(id,Health); SetPlayerHealth(id,Health-Config[SlapDecrement]);
GetPlayerPos(id, X, Y, Z); SetPlayerPos(id, X, Y, Z+5);
new string[128],name[MAX_PLAYER_NAME],ActionName[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name)); GetPlayerName(id,ActionName,sizeof(ActionName));
format(string,sizeof(string),"Administrator \"%s\" has bitch-slapped \"%s\".",name,ActionName);
SendClientMessageToAll(yellow,string);
return SendCommandMessageToAdmins(playerid,"SLAP");
}
Also, you should use the [ pawn] tags (without the space) so it indents properly :P