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