ycmd command and enum
#1

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,
pawn Код:
enum CommandData
{
    bool:aCommand
}
new cData[MAX_COMMANDS][CommandData];
Here is the cmds command just in case!
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;
}
Reply


Messages In This Thread
ycmd command and enum (STILL NEED HELP!) - by Crayder - 23.06.2014, 05:28
Re: ycmd command and enum - by Crayder - 23.06.2014, 05:33
Re: ycmd command and enum - by Threshold - 23.06.2014, 05:58
Re: ycmd command and enum - by Crayder - 23.06.2014, 06:04
Re: ycmd command and enum - by Crayder - 24.06.2014, 15:56
Re: ycmd command and enum - by Crayder - 26.06.2014, 05:12
Re: ycmd command and enum - by Crayder - 27.06.2014, 03:07
Re: ycmd command and enum - by Crayder - 28.06.2014, 06:11

Forum Jump:


Users browsing this thread: 1 Guest(s)