how to make other player to do a command
#3

ZCMD:
pawn Code:
CMD:command(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;
    new id, sendcommand[50], cmdparams;
    if(sscanf(params, "us[50]S[100]", id, sendcommand, cmdparams)) return SendClientMessage(playerid, -1, "USAGE: /command [name/id] [command] [Optional: parameters]");
    if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Invalid Player.");
    if(sendcommand[0] == '/') strdel(sendcommand, 0, 1);
    CallLocalFunction(sendcommand, "is", id, cmdparams);
    SendClientMessage(playerid, 0xFFFF00FF, "Command Sent.");
    return 1;
}
This should work.

Requires the following includes:
a_samp
sscanf2
zcmd
Reply


Messages In This Thread
how to make other player to do a command - by Dipto - 08.03.2014, 02:13
Re: how to make other player to do a command - by SkilledMaster - 08.03.2014, 03:21
Re: how to make other player to do a command - by Threshold - 08.03.2014, 03:43
Re: how to make other player to do a command - by Dipto - 08.03.2014, 03:51
Re: how to make other player to do a command - by Dipto - 08.03.2014, 03:54
Re: how to make other player to do a command - by Threshold - 08.03.2014, 08:19
Re: how to make other player to do a command - by Dipto - 08.03.2014, 17:28
Re: how to make other player to do a command - by Threshold - 09.03.2014, 11:05
Re: how to make other player to do a command - by QuaTTrO - 09.03.2014, 11:18
Re: how to make other player to do a command - by Dipto - 09.03.2014, 17:07

Forum Jump:


Users browsing this thread: 1 Guest(s)