23.06.2014, 05:28
(
Последний раз редактировалось Crayder; 24.06.2014 в 18:21.
Причина: STILL NEED HELP!
)
I have a problem consulting an enum and command ids, I wanna recognize commands as admin commands, therefore i set their aCommand value to true (aCommand is part of the enum as a bool). But during the process of setting the aCommand to true using this - "cData[cID][aCommand] = true;", the script freezes there! When i try to detect admin commands in my cmds command, the script freezes here, "if(!cData[Command_GetID(Command_GetNext(i, playerid))][aCommand]) continue;". So its something to do with this enum,
Here is the cmds command just in case!
pawn Код:
enum CommandData
{
bool:aCommand
}
new cData[MAX_COMMANDS][CommandData];
pawn Код:
YCMD:cmds(playerid, params[], help)
{
if (help)
{
SendPlayerMessage(playerid, COLOR_HELP, "[Command] Help: /Commands");
SendPlayerMessage(playerid, COLOR_MESG, "It lists all the commands you can use.");
}
else
{
new Str[25], CommandList[2500], count = Command_GetPlayerCommandCount(playerid);
for (new i=0; i!=count; i++)
{
if(!cData[Command_GetID(Command_GetNext(i, playerid))][aCommand]) continue;
else
{
format(Str, sizeof(Str), "%s\n", Command_GetNext(i, playerid));
strcat(CommandList, Str, sizeof(CommandList));
}
}
ShowPlayerDialog(playerid, 1010101, DIALOG_STYLE_LIST, "Your Available Commands", CommandList, "Next", "Close");
}
return 1;
}