Question enum.
#1

Hi !

pawn Код:
enum array
{
    array1,
    array2
}
It's ok.

pawn Код:
enum array
{
    array1 = -1,
    array2
}
It's not good, why?

I have errors

Thx
Reply
#2

Can you explain it please i dont understand you
Reply
#3

The value of " array1 " is " 0".

I want to get the value of " array1 " to " -1" , but when I do that, I get errors :

pawn Код:
enum array
{
    array1 = -1,
    array2
}
Reply
#4

I will tell you an example :

PHP код:
enum PlayerInfo
{
pArray,
pArray1,
.
.
.
}
new 
pInfo[MAX_PLAYERS][PlayerInfo]; 
You can use when player connect or Where you want to set it to -1

PHP код:
pInfo[playerid][pArray] = -1
This is
Reply
#5

The method shown by arlindi is the only one, and the right one.
Enums don't hold the data, your array does.
Presetting data inside the enum won't help and will screw things up even more than you realize.

It's all clearly explained here:
https://sampforum.blast.hk/showthread.php?tid=318307
Reply


Forum Jump:


Users browsing this thread: