[Tutorial] ZCMD: How to make 'forcecmd' command.
#8

This is more optimized :
PHP Code:
CMD:forcecmd(playeridparams[]) 
{
    new 
        
TargetID
        
Command[32], 
        
Params[129];
        
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -"{E03636}[ERROR]: {FFFFFF}You are not authorized to use this command!");
    if(
sscanf(params"us[32]S()[128]"TargetIDCommandParams)) 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(stringCommand[1]);
        
    if(!
CallLocalFunction(string"ds"TargetIDisnull(Params) ? ("\1") : Params)) return SendClientMessage(playerid, -1"{E03636}[ERROR]: {FFFFFF}This command is unknown.");

Reply


Messages In This Thread
ZCMD: How to make 'forcecmd' command. - by bgedition - 13.06.2015, 20:29
Re: ZCMD: How to make 'forcecmd' command. - by kristo - 13.06.2015, 20:52
Re: ZCMD: How to make 'forcecmd' command. - by Konverse - 13.06.2015, 20:55
Re: ZCMD: How to make 'forcecmd' command. - by bgedition - 13.06.2015, 20:55
Re: ZCMD: How to make 'forcecmd' command. - by kristo - 13.06.2015, 20:57
Re: ZCMD: How to make 'forcecmd' command. - by bgedition - 13.06.2015, 21:17
Re: ZCMD: How to make 'forcecmd' command. - by JaydenJason - 14.06.2015, 14:05
Re : ZCMD: How to make 'forcecmd' command. - by Dutheil - 15.06.2015, 12:30
Re: ZCMD: How to make 'forcecmd' command. - by Alpay0098 - 15.06.2015, 17:38
Re: ZCMD: How to make 'forcecmd' command. - by gurmani11 - 19.07.2015, 17:30

Forum Jump:


Users browsing this thread: 2 Guest(s)