15.06.2015, 12:30
(
Last edited by Dutheil; 15/06/2015 at 06:18 PM.
)
This is more optimized :
PHP Code:
CMD:forcecmd(playerid, params[])
{
new
TargetID,
Command[32],
Params[129];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1 , "{E03636}[ERROR]: {FFFFFF}You are not authorized to use this command!");
if(sscanf(params, "us[32]S()[128]", TargetID, Command, Params)) return SendClientMessage(playerid, -1, "{36E0B9}[USAGE]: {FFFFFF}/forcecmd <PlayerID/PartOfName> <Command> <Params>");
if(playerid == TargetID) return SendClientMessage(playerid, -1, "{E0AE36}[WARNING]: {FFFFFF}You cannot use this command on yourself.");
if(!IsPlayerConnected(TargetID)) return SendClientMessage(playerid, -1, "{E03636}[ERROR]: {FFFFFF}This player is not in this server.");
new
string[36] = "cmd_";
strcat(string, Command[1]);
if(!CallLocalFunction(string, "ds", TargetID, isnull(Params) ? ("\1") : Params)) return SendClientMessage(playerid, -1, "{E03636}[ERROR]: {FFFFFF}This command is unknown.");
}