send command help
#8

Now that I think about it, this might make more sense:

pawn Code:
CMD:sendcmd(playerid, params[])
{
    new npcid, actualcmd[30], cmdparams[150];
    if(sscanf(params, "us[30]S[150]", npcid, actualcmd, cmdparams)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sendcmd [playerid] [cmd] [cmdparams]");
    if(cmdparams[0] != '/') return SendClientMessage(playerid, COLOR_WHITE, "Invalid command entered.");
    if(!IsPlayerConnected(npcid)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid player!");
    if(!IsPlayerNPC(npcid)) return SendClientMessage(playerid, COLOR_GREY, "You can only use this command on an NPC.");
    format(actualcmd, sizeof(actualcmd), "cmd_%s", actualcmd);
    CallRemoteFunction(actualcmd, "is", npcid, cmdparams);
    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)