SA-MP Forums Archive
Print all ZCDM 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: Print all ZCDM Commands (/showthread.php?tid=459510)



Print all ZCDM Commands - saamp - 23.08.2013

Hello guys. How can I do that? I saw somewhere a method with ******'s include ( y_scripting ) but that it's not more available.


Re: Print all ZCDM Commands - doreto - 23.08.2013

http://pastebin.com/USpNTbu7 by Lorenc (not testet)


Re: Print all ZCDM Commands - RedJohn - 23.08.2013

pawn Код:
#include <YSI/y_scripting>
pawn Код:
stock DisplayCommands( )
{
    static
        szBuffer[1024],
        szPublic[32],
        iCount
    ;

    if(!szBuffer[0])
    {
        while((iCount = Scripting_GetPublicFast(iCount, szPublic, (Scripting_FastString('c', 'm', 'd', '_')))))
        {
            format(szBuffer, sizeof(szBuffer), "%s/%s\n", szBuffer, szPublic[4]);
        }
    }
    return szBuffer;
}
Usage:
pawn Код:
ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_LIST, "Commands", DisplayCommands(), "Close", "");



Re: Print all ZCDM Commands - RajatPawar - 23.08.2013

If this doesn't work, probably open your AMX with notepad, search for "cmd_" and you'll have all your commands displayed in an alphabetical order.
Eg ( cmd_apple, cmd_banana )


Re: Print all ZCDM Commands - RedJohn - 23.08.2013

No ******, Lorenc's code is not working for me, and one that I posted is working just fine.


Re: Print all ZCDM Commands - RedJohn - 23.08.2013

I know man but when I use that code, dialog is blank.


Re: Print all ZCDM Commands - RedJohn - 23.08.2013

I'm very very very sorry, I failed.

I thought that Lorenc's code is not working, but this is not that's not working: http://forum.sa-mp.com/showpost.php?...postcount=2961


Re: Print all ZCDM Commands - saamp - 24.08.2013

Where can I find y_scripting library? I can't find it on ******'s wiki.


Re: Print all ZCDM Commands - saamp - 24.08.2013

With this code:

pawn Код:
// Top of script
#include <YSI\y_amx>

// Somewhere
stock GetAllZCMDCommands()
{
    static  szBuffer[1024],
            szPublic[32],
            idx;
       
    szBuffer[0] = '\0';
    szPublic[0] = '\0';
    idx = 0;
    while ((idx = AMX_GetPublicNamePrefix(idx, szPublic, _A<cmd_>)))
    {
        format(szBuffer, sizeof (szBuffer), "%s/%s\n", szBuffer, szPublic);
    }
    return szBuffer;
}

// OnGameModeInit
{
.................
printf("%s", GetAllZCMDCommands());
}
I'm getting this: /imageshack/img843/7093/xrpj.png