14.03.2013, 03:12
dcmd_slap(playerid,params[]) {
if(IsPlayerCommandLevel(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 != 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]);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(id, X, Y, Z);
SetPlayerPos(id, X, Y, Z+5);
} else return SendClientMessage(playerid,red,"ERROR: You can not slap yourself or a disconnected player.");
} else return SendLevelErrorMessage(playerid,"slap");
Like this or am I totally wrong?
I get a few warnings
: warning 217: loose indentation
: warning 225: : warning 217: loose indentation
: warning 209: function "dcmd_slap" should return a value
if(IsPlayerCommandLevel(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 != 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]);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(id, X, Y, Z);
SetPlayerPos(id, X, Y, Z+5);
} else return SendClientMessage(playerid,red,"ERROR: You can not slap yourself or a disconnected player.");
} else return SendLevelErrorMessage(playerid,"slap");
Like this or am I totally wrong?
I get a few warnings
: warning 217: loose indentation
: warning 225: : warning 217: loose indentation
: warning 209: function "dcmd_slap" should return a value