send command help
#10

pawn Code:
CMD:sendcmd(playerid, params[])
{
    new npcid, cmd[128], msg[128], sendedcmd[128];
    if(!sscanf(params, "us[128]s[128]", npcid, cmd, sendedcmd))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /sendcmd [playerid] [cmd] [cmdparams]");
        SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: ban - kick - slap - pm - o - w");
        return 1;
    }
    if(!IsPlayerConnected(npcid))
    {
        SendClientMessage(playerid, COLOR_WHITE, "Invalid player!");
        return 1;
    }
    if(!IsPlayerNPC(npcid))
    {
        SendClientMessage(playerid, COLOR_GREY, "You can only use this command on NPC.");
        return 1;
    }
   
    format(msg, sizeof(msg), "/%s", cmd);
    CallLocalFunction("OnPlayerCommandText", "is", npcid, msg);
   
    format(msg, sizeof(msg), "/sendcmd %s.", cmd, sendedcmd);
    SendClientMessage(playerid, COLOR_WHITE, msg);
    return 1;
}
Reply


Messages In This Thread
send command help - by JacobSanchez - 19.02.2014, 22:51
Re: send command help - by Threshold - 19.02.2014, 23:21
Re: send command help - by JacobSanchez - 19.02.2014, 23:30
Respuesta: send command help - by CuervO - 20.02.2014, 00:49
Re: send command help - by JacobSanchez - 20.02.2014, 01:14
Respuesta: send command help - by CuervO - 20.02.2014, 01:16
Re: send command help - by JacobSanchez - 20.02.2014, 01:45
Re: send command help - by Threshold - 20.02.2014, 10:06
Re: send command help - by JacobSanchez - 20.02.2014, 19:16
Respuesta: send command help - by OTACON - 20.02.2014, 19:23

Forum Jump:


Users browsing this thread: 1 Guest(s)