ZCMD and DCMD - 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: ZCMD and DCMD (
/showthread.php?tid=464903)
ZCMD and DCMD -
AnonScripter - 19.09.2013
what's the difference between dcmd and zcmd ?? and when we have to use each one ?
Re: ZCMD and DCMD -
Konstantinos - 19.09.2013
ZCMD is recommended.
Quote:
Originally Posted by ZCMD's Thread
This is just a little include that uses OnPlayerCommandText() to process players' commands. Each command has a separate function like in dcmd, but zcmd calls them directly via CallLocalFunction(). Such method is much faster than when you successively compare the text player entered to each command you have in your script (especially if he send a nonexistent cmd, you pass though all then) and its superiority over the old way is proportional to the number of commands.
|
DCMD is just a macro of the default method (using strcmp which means slower).
Re: ZCMD and DCMD -
Lidor124 - 19.09.2013
DCMD is a type of making command and ZCMD is also, actually not much differents, just the style
dcmd_mycommand(playerid, params[]) using strcmp
CMD:mycommand(playerid, params[])
I'm using ZCMD
Re: ZCMD and DCMD -
EiresJason - 19.09.2013
Quote:
Originally Posted by Lidor124
DCMD is a type of making command and ZCMD is also, actually not much differents, just the style
dcmd_mycommand(playerid, params[]) using strcmp
CMD:mycommand(playerid, params[])
I'm using ZCMD
|
ZCMD is faster though, I saw a chart before that ****** posted; comparing the speed of DCMD/ZCMD/YCMD and ZCMD+YCMD are much faster.
The picture doesn't exist anymore but it was originally here:
https://sampforum.blast.hk/showthread.php?tid=416104&page=2
Re: ZCMD and DCMD -
Konstantinos - 19.09.2013
Quote:
Originally Posted by EiresJason
ZCMD is faster though, I saw a chart comparing the speed of DCMD/ZCMD/YCMD and ZCMD+YCMD are much faster.
|
Indeed they are and actually y_commands is faster than ZCMD (for over 100 commands and from what I've read, y_commands is going to be much faster in the next release of YSI Library).
EDIT: Here's the picture:
/imageshack/img195/43/fourcommands.png
Re: ZCMD and DCMD -
EiresJason - 19.09.2013
Nice
Re: ZCMD and DCMD -
AnonScripter - 19.09.2013
What do you mean by faster and fastest ?
Re: ZCMD and DCMD -
EiresJason - 19.09.2013
The average execution time. See the link Konstantinos posted.