calling enum with index
#1

Hi, I wanted to ask you a question.

Wanted to know if the enum have indices bone to not call them by how we declare it, but by a number.

Example:

pawn Код:
enum SI
{
    MaxPing, // INDEX 0
    MaxPacket, // INDEX 1
    MinFPS // INDEX 2
};
new ServerInfo[SI];

ServerInfo[0] = value;
now I tried to do so, but throws me the following errors:
pawn Код:
dir(863) : warning 213: tag mismatch
dir(863) : error 006: must be assigned to an array

This is my code:
pawn Код:
case DIALOG_MENUSERVER:
        {
            if(response)
            {
                IDL = listitem;
                if(ConfigVal(IDL) == "0" || ConfigVal(IDL) == "1")
                {
                    new params[1];
                    cmd_configmenu(playerid,params);
                }
                else
                {
                    ShowPlayerDialog(playerid,DIALOG_VALORCONFIG,DIALOG_STYLE_INPUT,"Config","Insert new value:","Accept","Exit");
                }
            }
        }
        case DIALOG_VALOROONFIG:
        {
            if(response)
            {
                ServidorInfo[IDL] = inputtext;
            }
        }
Thakns, and sorry for my bad english.
Reply


Messages In This Thread
calling enum with index - by mcreed - 25.03.2016, 18:16
Re: calling enum with index - by Mencent - 25.03.2016, 18:25
Respuesta: Re: calling enum with index - by mcreed - 25.03.2016, 18:34
Re: calling enum with index - by Mencent - 25.03.2016, 18:36
Respuesta: calling enum with index - by mcreed - 25.03.2016, 18:37
Re: calling enum with index - by Mencent - 25.03.2016, 20:21
Respuesta: Re: calling enum with index - by mcreed - 25.03.2016, 21:08
Re: calling enum with index - by Misiur - 25.03.2016, 21:54
Re: calling enum with index - by Gammix - 25.03.2016, 21:54
Respuesta: Re: calling enum with index - by mcreed - 25.03.2016, 23:00

Forum Jump:


Users browsing this thread: 2 Guest(s)