SA-MP Forums Archive
Can i use ZCMD and Strcmp together? - 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: Can i use ZCMD and Strcmp together? (/showthread.php?tid=311416)



Can i use ZCMD and Strcmp together? - Nemesis' - 16.01.2012

Topic says all "Can i use ZCMD and Strcmp together in one Script?"


Re: Can i use ZCMD and Strcmp together? - Jaxson - 16.01.2012

Of course you can.


Re: Can i use ZCMD and Strcmp together? - Nemesis' - 16.01.2012

Please tell me how can i , i am new to Scripting where do i place the STRCMP Code?


Re: Can i use ZCMD and Strcmp together? - Jaxson - 16.01.2012

Place it under the OnPlayerCommandText callback to check what command the player has entered.


Re: Can i use ZCMD and Strcmp together? - Konstantinos - 16.01.2012

Quote:
Originally Posted by Jaxson
Посмотреть сообщение
Of course you can.
Quote:
Originally Posted by Jaxson
Посмотреть сообщение
Place it under the OnPlayerCommandText callback to check what command the player has entered.
No, you can't. If you are using ZCMD all the strcmp commands will be SERVER: Unknown command.
However, ZCMD never should be inside any callback like OnPlayerCommandText.
The only way ZCMD + strcmp is together on this.
pawn Код:
CMD:test(playerid, params[ ] )
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /test <first / second>");
    if(strcmp(params, "first", true) == 0)
    {
        // First test
    }
    else if(strcmp(params, "second", true) == 0)
    {
        // Second Test
    }
    return 1;
}



Re: Can i use ZCMD and Strcmp together? - Nemesis' - 16.01.2012

Thanks Dwane


Re: Can i use ZCMD and Strcmp together? - Nemesis' - 16.01.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
Yes you can. "OnPlayerCommandText" is never called, but there are two new callbacks - "OnPlayerCommandReceived" and "OnPlayerCommandPerformed" added. If you put your strcmp commands in the former they should work - not that it's at all recommended.
Godfather you Rocks thanks Alot...