28.01.2011, 09:51
Tested and works.
You need YSI/y_scripting for this to work, you can remove the OnGameModeInit callback as it was a test to verify it compiled.
pawn Код:
#include <a_samp>
#include <zcmd>
#include <YSI/y_scripting>
main() {
}
public OnGameModeInit() {
printf("Commands: %d", countCommands());
return 1;
}
CMD:test(playerid, params[]) {
print("lol");
}
stock countCommands() {
new
cmdBuffer[32],
commandCount;
for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
Scripting_GetPublic(it, cmdBuffer);
if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
commandCount++;
}
}
return commandCount;
}