ZCMD and STRCMP problem
#1

Well, I am trying to convert my gamemode commands to ZCMD, (its a gf edit) but when I make a command with zcmd, and when I made a cmd like "/id" (COMMAND:ID etc etc), I cannot use other commands in strcmp
all it says "SERVER UNKNOWN COMMAND"

help please
Reply
#2

ZCMD, and strcmp commands cannot be used together AFAIK. All commands have to be ZCMD or strcmp, you can't mix the two.
Reply
#3

What about dcmd? yes?
Reply
#4

dcmd can be, because zcmd disables the OnPlayerCommandText callback.
Reply
#5

Quote:
Originally Posted by Markx
Посмотреть сообщение
dcmd can be, because zcmd disables the OnPlayerCommandText callback.
oh really?

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    //strcmp
    if(!strcmp(cmdtext,"/MyCommand",true))
    {
        SendClientMessage(playerid,0,"It works and this text is black!");
        return 1;
    }
    //zcmd
    if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
    {
        return 1;
    }
    new
        pos,
        funcname[MAX_FUNC_NAME];
    while (cmdtext[++pos] > ' ')
    {
        funcname[pos-1] = tolower(cmdtext[pos]);
    }
    format(funcname, sizeof(funcname), "cmd_%s", funcname);
    while (cmdtext[pos] == ' ') pos++;
    if (!cmdtext[pos])
    {
        if (zcmd_g_HasOPCE)
        {
            return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, "\1"));
        }
        return CallLocalFunction(funcname, "is", playerid, "\1");
    }
    if (zcmd_g_HasOPCE)
    {
        return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, cmdtext[pos]));
    }
    return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]);
}
just put the strcmp command(s) BEFORE zcmd.

Anyway I do not recomend using 2 command processors at one time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)