[!]Using strcmp for commands[!] - 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: [!]Using strcmp for commands[!] (
/showthread.php?tid=518246)
[!]Using strcmp for commands[!] -
TakeiT - 09.06.2014
I'm posting this here as a note to all new scripters. Using String Compare (strcmp) under OnPlayerCommandText is extremely inefficient and outdated. If you download a gamemode that uses strcmp, then the script is overall outdated. You will either need to convert to a different command processor (most people use ZCMD, however it isn't the only option) or just do yourself a favour and download a newer gamemode. Using these types of scripts will not help you learn how to properly script, so overall you are WASTING your time. It IS possible to update your current gamemode. By doing so, you will not only make your life easier by learning faster more efficient ways to script, but you will also be doing us a favor when you post for help.
You should download ZCMD by ZEEX
HERE
and SSCANF by ******
HERE
You can convert your gamemode by following one of many tutorials.
HERE is a good converter.
Thank you all,
-TakeiT
Re: [!]Using strcmp for commands[!] -
Ciandlah - 09.06.2014
You are wrong buddy, If STRCMP is so inceffeicent then why is Kalcor developing SAMP in it and making it - it's default code?
All that has happened is ****** and a couple of other developer have created a process that is more easier to use.
Believe it or not ****** done a comparison on command processors.
Re: [!]Using strcmp for commands[!] -
Konstantinos - 09.06.2014
Quote:
Originally Posted by Ciandlah
You are wrong buddy, If STRCMP is so inceffeicent then why is Kalcor developing SAMP in it and making it - it's default code?
All that has happened is ****** and a couple of other developer have created a process that is more easier to use.
Believe it or not ****** done a comparison on command processors.
|
So if a script from the server package which was written in 2009 uses strcmp + strtok, does that mean you should use it too because it was written by the developer of SA-MP? We're on 2014! New stuff have been released and they're faster. You should really consider using them.
And by the way, the scripts from the server package do not use any plugin or include released on the forum for obvious reasons so it uses strcmp, strtok, file functions which are not recommended at all.
I totally agree with TakeiT about it, ZCMD or y_commands + sscanf is the best combination.