23.08.2013, 12:11
Hello guys. How can I do that? I saw somewhere a method with ******'s include ( y_scripting ) but that it's not more available.
#include <YSI/y_scripting>
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;
}
ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_LIST, "Commands", DisplayCommands(), "Close", "");
// 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());
}