SA-MP Forums Archive
zcmd or onplayercommand? - 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 or onplayercommand? (/showthread.php?tid=583013)



zcmd or onplayercommand? - TheSkyBlueTeam - 25.07.2015

Whats the best? I have over 100+ commands with onplayercommand, but I'm not sure if im gonna switch over to zcmd.


Re: zcmd or onplayercommand? - J0sh... - 25.07.2015

ZCMD.


Re: zcmd or onplayercommand? - DaDenz - 25.07.2015

ZCMD in my opinion is a better choise then onplayercommand,
Also YCMD is a good alternative,
You should choose which one you prefer actually.

Good luck =D


Re: zcmd or onplayercommand? - SickAttack - 25.07.2015

Switch over to any command processor that uses 'CallLocalFunction(...)'. The reason why 'strcmp' commands are slow is because it has to validate whether the entered command matches any of the commands on the server.

Trying to execute the last placed command on the callback will have to go through all the commands before it first, and perform a check for every command (strcmp commands). And command processors that call the function (command) directly (CallLocalFunction(...)), goes through the same steps - the only difference between performance is what is allotted in the used command's process.

Also, it's 'OnPlayerCommandText(...)', not 'OnPlayerCommand(...)'.


Re: zcmd or onplayercommand? - TheSkyBlueTeam - 25.07.2015

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Switch over to any command processor that uses 'CallLocalFunction(...)'. The reason why 'strcmp' commands are slow is because it has to validate whether the entered command matches any of the commands on the server.

Trying to execute the last placed command on the callback will have to go through all the commands before it first, and perform a check for every command (strcmp commands). And command processors that call the function (command) directly (CallLocalFunction(...)), goes through the same steps - the only difference between performance is what is allotted in the used command's process.

Also, it's 'OnPlayerCommandText(...)', not 'OnPlayerCommand(...)'.
Thanks, think I'm gonna switch to zcmd now.