Switchen to ZCMD
#1

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?
Reply
#2

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]
Reply
#3

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

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).
Reply
#5

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?
Reply
#6

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

Hmm okay, Also I found a weird problem, at commands I used this:
pawn Код:
if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName] [Reason]");
This just worked, means I can use sscanf, but I never included it at the top.
But now when I include it, my PAWNO compiler crashed.
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)