SA-MP Forums Archive
ycmd command and enum - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ycmd command and enum (/showthread.php?tid=521440)



ycmd command and enum (STILL NEED HELP!) - Crayder - 23.06.2014

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;
}



Re: ycmd command and enum - Crayder - 23.06.2014

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


Re: ycmd command and enum - Threshold - 23.06.2014

EDIT: Lol, misread the question -_-


Re: ycmd command and enum - Crayder - 23.06.2014

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!


Re: ycmd command and enum - Crayder - 24.06.2014

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


Re: ycmd command and enum - Crayder - 26.06.2014

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


Re: ycmd command and enum - Crayder - 27.06.2014

PLEASE HELP! (Bump, again...)


Re: ycmd command and enum - Crayder - 28.06.2014

Bump... AGAIN