23.06.2013, 16:25
I made an enum with all admin commands and require level, then I made a stock to send a message of the cmds.
here are the codes:
Enum:
Now the stock:
The problem is that when the count is equal to 8, the \n doesn't works the cmds are at the same line.
Picture:
here are the codes:
Enum:
pawn Код:
enum A_COMMANDS
{
aCommand[24],
aLevel
}
new AdminCommands[][A_COMMANDS] = {
{"goto", ADMIN_1},
{"gethere", ADMIN_1},
{"ban", ADMIN_1},
{"kick", ADMIN_1},
{"ajail", ADMIN_1},
{"slap", ADMIN_1},
{"freeze", ADMIN_1},
{"unfreeze", ADMIN_1},
{"mute", ADMIN_1},
{"getcar", ADMIN_1},
{"gotocar", ADMIN_1}
};
pawn Код:
stock DisplayLevelCommands(playerid, level)
{
new count = 0, cmds[256];
SCMEx(playerid, COLOR_LIGHTRED, "Admin Level %d Commands", level);
for(new i = 0; i < sizeof(AdminCommands); i++)
{
if(AdminCommands[i][aLevel] == level)
{
format(mstr, sizeof(mstr), " /%s |", AdminCommands[i][aCommand]);
strcat(cmds, mstr);
count++;
if(count == 8)
{
strcat(cmds, "\n");
count = 0;
}
}
}
SCM(playerid, COLOR_WHITE, cmds);
return 1;
}
The problem is that when the count is equal to 8, the \n doesn't works the cmds are at the same line.
Picture: