Can i use ZCMD and Strcmp together?
#1

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

Of course you can.
Reply
#3

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

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

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;
}
Reply
#6

Thanks Dwane
Reply
#7

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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)