Print all ZCDM Commands
#1

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

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

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", "");
Reply
#4

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 )
Reply
#5

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

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

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
Reply
#8

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)