send command help
#2

Hmmmm... would this work?

pawn Code:
CMD:sendcmd(playerid, params[])
{
    new npcid, sendedcmd[150];
    if(sscanf(params, "us[150]", npcid, sendedcmd)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /sendcmd [playerid] [cmd] [cmdparams]");
    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 NPC.");
    if(OnPlayerCommandText(npcid, sendedcmd) == 0) return SendClientMessage(playerid, COLOR_GREY, "This is not a valid command!");
    format(sendedcmd, sizeof(sendedcmd), "/sendcmd %s.", sendedcmd);
    SendClientMessage(playerid, COLOR_WHITE, sendedcmd);
    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)