ZCMD [do command to player]
#1

Hello
I want to make a command seems not possible ZCMD ..
Look I want to do something like this only ZCMD:
pawn Код:
if(!strcmp(cmd, "/PlayerCommand", true))
    {
        new command[128];
        cmd = strtok(cmdtext, idx);
        if(!strlen(cmd)) return ...
        command = strtok(cmdtext, idx);
        if(!strlen(command)) return ...
        OnPlayerCommandText(strval(cmd), command);
        return true;
    }
I tried to do this and does not work:
pawn Код:
CMD:playercommand(playerid, params[])
{
    if(sscanf(params, "rs[128]", params[0], params[1])) return ...
    cmd_params[1](params[0], params);
    return true;
}
This brings me to the following errors:
pawn Код:
C:\Users\*\Desktop\* 0.3x\gamemodes\*.pwn(1062) : error 029: invalid expression, assumed zero
C:\Users\*\Desktop\* 0.3x\gamemodes\*.pwn(1063) : error 017: undefined symbol "cmd_params"
C:\Users\*\Desktop\* 0.3x\gamemodes\*.pwn(1063) : warning 215: expression has no effect
C:\Users\*\Desktop\* 0.3x\gamemodes\*.pwn(1063) : error 001: expected token: ";", but found "]"
C:\Users\*\Desktop\* 0.3x\gamemodes\*.pwn(1063) : error 029: invalid expression, assumed zero
C:\Users\*\Desktop\* 0.3x\gamemodes\*.pwn(1063) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Reply
#2

pawn Код:
CMD:playercommand(playerid, params[]) {
    if(sscanf(params, "us[128]", params[0], params[1])) return ...
    CallLocalFunction("OnPlayerCommandText", "is", params[0], params[1]);
    return true;
}
Reply
#3

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
pawn Код:
CMD:playercommand(playerid, params[]) {
    if(sscanf(params, "us[128]", params[0], params[1])) return ...
    OnPlayerCommandText(params[0], params[1]);
    return true;
}
But it ZCMD this work?
Reply
#4

Changed it to CallLocalFunction because their is an als hook in zcmd without any reason...
Reply
#5

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Changed it to CallLocalFunction because their is an als hook in zcmd without any reason...
Thanks !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)