Simple Slap command
#4

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
Reply


Messages In This Thread
Simple Slap command - by master2466 - 14.03.2013, 03:02
Re: Simple Slap command - by [ABK]Antonio - 14.03.2013, 03:05
Re: Simple Slap command - by master2466 - 14.03.2013, 03:06
Re: Simple Slap command - by master2466 - 14.03.2013, 03:12
Re: Simple Slap command - by master2466 - 14.03.2013, 03:14
Re: Simple Slap command - by [ABK]Antonio - 14.03.2013, 03:25
Re: Simple Slap command - by master2466 - 14.03.2013, 03:29

Forum Jump:


Users browsing this thread: 1 Guest(s)