SA-MP Forums Archive
Switchen to ZCMD - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Switchen to ZCMD (/showthread.php?tid=275079)



Switchen to ZCMD - Kingunit - 08.08.2011

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?


Re: Switchen to ZCMD - Calgon - 08.08.2011

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]


Re: Switchen to ZCMD - Kingunit - 08.08.2011

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.


Re: Switchen to ZCMD - Calgon - 08.08.2011

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


Re: Switchen to ZCMD - Kingunit - 08.08.2011

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?


Re: Switchen to ZCMD - Calgon - 08.08.2011

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.


Re: Switchen to ZCMD - Kingunit - 08.08.2011

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.


Re: Switchen to ZCMD - Kingunit - 08.08.2011

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.