SA-MP Forums Archive
help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help (/showthread.php?tid=525938)



help - krytans - 14.07.2014

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.


Re: help - kamiliuxliuxliux - 14.07.2014

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
}



Re: help - krytans - 14.07.2014

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

do i need to change it to OnPlayerCommandText(..) ?


Re: help - kamiliuxliuxliux - 14.07.2014

I think you should.


Re: help - krytans - 14.07.2014

i did that. but that problem remains.


Re: help - kamiliuxliuxliux - 14.07.2014

Show the whole code written in that callback.