#1

In my gamemode has bunch of zcmd and strcmp commands. strcmp commands are inside public OnPlayerCommandReceived(playerid, cmdtext[]). And zcmd are outside.

The problem is when i using strcmp commands in game, its executed but returns Server:Unknown Command.
all zcmds are working perfectly.
I want to know any solutions to fix this. I can't convert strcmp to zcmd because it has bunch of command, it takes lot of time.

I want to know any solution to fix this.
Reply
#2

Maybe you mean OnPlayerCommandText(...)? Then:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1; // MAKE SURE YOU ALWAYS RETURN HERE 1;
    }
    return 0; // AND 0 HERE
}
Reply
#3

Nope, strcmp commands are in public OnPlayerCommandReceived(...)

do i need to change it to OnPlayerCommandText(..) ?
Reply
#4

I think you should.
Reply
#5

i did that. but that problem remains.
Reply
#6

Show the whole code written in that callback.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)