SA-MP Forums Archive
GET ALL 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: GET ALL COMMANDS (/showthread.php?tid=607350)



GET ALL COMMANDS - 2k16 - 18.05.2016

Possible to get all commands? ZCMD.


Re: GET ALL COMMANDS - SyS - 18.05.2016

what u mean?


Re: GET ALL COMMANDS - Konstantinos - 18.05.2016

You can get a list of the commands are used to a script by using y_amx (part of YSI). I don't know if it differs in YSI 3.1 and YSI 4 (which I used).

PHP код:
#include <YSI\y_amx>
...
static
    list[
512], // change its value depending on how many commands you got
    
buffer[32],
    
count;
        
while ((
count = AMX_GetName(AMX_TABLE_PUBLICS, count, buffer, "cmd_")))
{
    if (!
strcmp(buffer, "zcmd_OnGameModeInit") || !strcmp(buffer, "zcmd_OnFilterScriptInit")) continue;
    
strmid(buffer, buffer, 4, strlen(buffer), sizeof buffer);
    
strins(buffer, "/", 0, sizeof buffer);
    
strcat(list, buffer, sizeof list);
    
strcat(list, "\n", sizeof list);
}
print(list);