14.06.2015, 15:06
Quote:
Your code is missing the flag #define ICMD_CALLBACK, to use OnCommandCalled, then you don't need to create this forward again, it already exists on inc file.
|
By the way, I made a pull request at github for ICMD!!
-------------------------------------------------------------------------------------
I-ZCMD new update is 3x faster than ZCMD,5x faster than y_commands and slightly faster than ICMD
I-ZCMD (v0.2) is 2.79 times faster than ZCMD
I-ZCMD (v0.2) is 5.06 times faster than y_commands
I-ZCMD (v0.2) is 1.35 times faster than ICMD
Speed Test Code for ICMD Benchmark
Код:
#include <a_samp> #define IZCMD #if defined ICMD #define ICMD_CALLBACK #include <icmd> public OnCommandCalled(playerid, cmd[]) { if (!cmd_exists(cmd)) { return ICMD_ERROR; } return ICMD_OKAY; } public Listeners(playerid, params[]) { get_cmd_params(mycommand) { return 1; } return 0; } #endif #if defined IZCMD #include <XCMD> COMMAND:mycommand(playerid,params[]) { return CMD_SUCCESS; } public OnPlayerCommandReceived(playerid,cmdtext[]) { return 1; } public OnPlayerCommandPerformed(playerid,cmdtext[], success) { return success; } #endif main () { new a = GetTickCount(); for(new i = 0;i < 1000000;i++) CallLocalFunction("OnPlayerCommandText","is",0,"/mycommand someshit"); new b = GetTickCount(); printf("%d",b-a); }