How to add a reason?
#6

You forgot to include the reason in the message sent.

pawn Код:
CMD:slap(playerid,params[])
{
    if(pInfo[playerid][pAdminLevel] >= 2 || IsPlayerAdmin(playerid))
    {
        new targetid, reason[128], string[256];
        if(sscanf(params, "us[128]", targetid,reason)) return  SendClientMessage(playerid,-1,""chat" /slap [playerid] [reason]"); //after this, do whatever you want to with the reason.
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");

        new Float:posxx[3];
        GetPlayerPos(targetid, posxx[0], posxx[1], posxx[2]);
        SetPlayerPos(targetid, posxx[0], posxx[1], posxx[2]+20);

        if(IsPlayerAdmin(playerid))
        {
            format(string, sizeof(string), ""chat" RCON Admin has slapped %s for reason: %s",PlayerName(targetid), reason);
            SendClientMessageToAll(-1,string);
        }
        else
        {
            format(string, sizeof(string), ""chat""COL_RED" %s %s has slapped %s, reason: %s",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid), reason);
            SendClientMessageToAll(-1,string);
        }
    }
    else {
        SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!");
    }
    return 1;
}
Reply


Messages In This Thread
How to add a reason? - by NoahF - 07.05.2013, 20:01
Re: How to add a reason? - by BigGroter - 07.05.2013, 20:21
Re: How to add a reason? - by NoahF - 07.05.2013, 20:26
Re: How to add a reason? - by BigGroter - 07.05.2013, 20:27
Re: How to add a reason? - by BenTaylorUK - 07.05.2013, 20:52
Re: How to add a reason? - by RevolutionaryGaming - 07.05.2013, 20:52

Forum Jump:


Users browsing this thread: 1 Guest(s)