SA-MP Forums Archive
This Command Doesn't Work,Why? - 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: This Command Doesn't Work,Why? (/showthread.php?tid=495640)



This Command Doesn't Work,Why? - Youssef214 - 18.02.2014

Why This Command Doesn't Work? It Sends Me "Server: unknown command."

pawn Код:
if(!strcmp(cmdtext, "/cmds", true))
    {
        ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "Server Commands", "/sdogdm - To Join The Snoop Dog Mansion Fight\n/dclubdm - To Join The Dance Club Fight\n/gpdm - To Join The Glen Park Fight\n/muldm - To Join The Mulholland Fight\n/home - To Return To Your Gangzone\n@ - To Speak In Team Chat\n/help - To See The Help Menu\n/rules - To See The Server Rules\n/checkvip [playerid] - To Check If A Player Is A VIP", "Continue", "Back");
        return 1;
    }



Re: This Command Doesn't Work,Why? - ChandraLouis - 18.02.2014

#define DIALOG_COMMANDS 1
add it


Re: This Command Doesn't Work,Why? - Youssef214 - 18.02.2014

i have already defined it: #define DIALOG_COMMANDS 1,But i noticed something,When I use COMMAND:anycmdhere,it works but under OnPlayerCommandText,The cmds under it doesn't work.


Re: This Command Doesn't Work,Why? - ChandraLouis - 18.02.2014

why you dont try use ZCMD ?


Re: This Command Doesn't Work,Why? - Youssef214 - 18.02.2014

include ZCMD?,i have already using it,ohhh i knew how to fix this problem.


Re: This Command Doesn't Work,Why? - Raza2013 - 18.02.2014

Use ZCMD


Re: This Command Doesn't Work,Why? - Cvnnor - 18.02.2014

Use ZCMD bro, much faster command processing and would probably eliminate the bug you're getting. Just put this at the top of the script.

pawn Код:
#include <zcmd>
In the topic I linked the word "ZCMD" to there is a lot more information, and it is in a lot more in depth then this brief paragraph, so just read the information on the topic and you should be good to go.


Re: This Command Doesn't Work,Why? - GamemodeRP123 - 18.02.2014

Use zcmd it is much better


Re: This Command Doesn't Work,Why? - Youssef214 - 18.02.2014

i knew how to fix this problem but by other way,i deleted include zcmd and used dcmd easier


Re: This Command Doesn't Work,Why? - Konstantinos - 18.02.2014

The reason you got unknown command message is because you cannot use both ZCMD and strcmp in the same script. Dcmp is just a macro and it still uses strcmp which is slower than ZCMD/y_commands.