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
#2

Also, i get no reply from the server when using this command, but /help cmd works so the command is there...
Reply
#3

EDIT: Lol, misread the question -_-
Reply
#4

Yea, i used to do that, but now i use all of ysi, which means admin commands are controlled by groups, i want a way to specify whether the command id is admin or not which is why I used this on ask admin commands, "cData
[cID][aCommand] = true;", unfortunately the script freezes there. So i need help with that. Thanks though.

Quote:
Originally Posted by Threshold
Посмотреть сообщение
EDIT: Lol, misread the question -_-
Sorry if I'm misleading, using my phone!
Reply
#5

Can somebody give me at least some suggestions? PS. Thanks!
Reply
#6

Bump - Can someone at least try. Has anyone else ever had problems setting an enum bool to false..
Reply
#7

PLEASE HELP! (Bump, again...)
Reply
#8

Bump... AGAIN
Reply


Forum Jump:


Users browsing this thread: