Posts: 1,426
Threads: 56
Joined: Dec 2010
Reputation:
0
Hello,
Let's say all my commands are scripted with !strcmp alot of people recommend me to switch to ZCMD.
The only thing I need to do is, converting all my commands to ZCMD?
Posts: 6,129
Threads: 36
Joined: Jan 2009
ZCMD with sscanf is faster than the conventional usage of strcmp/strtok in OnPlayerCommandText, yes.
You would need to get the zcmd include and manually convert all of your commands to follow the format for commands with ZCMD and sscanf,
there are loads of tutorials.
There's even a ******* one: [ame]http://www.youtube.com/watch?v=HwBeNNjLB8k[/ame]
Posts: 1,426
Threads: 56
Joined: Dec 2010
Reputation:
0
Thank you Calg00ne, I'm already using SSCANF so that's not a problem. But I don't need to change something at my login/register system? That's working fine without editing? Going to watch the video right now.
Posts: 6,129
Threads: 36
Joined: Jan 2009
The only thing you need to do is change the way your commands are processed, so you only need to move a bit of code around - there's not really anything else you need to change.
You can even use a script to do it for you (changes OnPlayerCommandText/strcmp commands to zcmd).
Posts: 1,426
Threads: 56
Joined: Dec 2010
Reputation:
0
Looks good, Also I am going to check out that filterscript, if it's actually working!
But there is really a difference? It's really faster and better for in the future?
Posts: 6,129
Threads: 36
Joined: Jan 2009
ZCMD processes commands in mass faster, so if you have a popular server (or are expecting to), switching to ZCMD is highly advised. It's generally wise for optimization even if not.
Posts: 1,426
Threads: 56
Joined: Dec 2010
Reputation:
0
UPDATE: I saw I just need to remove OnPlayerCommand. And past the command codes just in the script.
But I'm getting alot of 'shadow' errors.