Simple Slap command
#6

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");
}
Try that out

Also, you should use the [ pawn] tags (without the space) so it indents properly :P
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)