Question 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: Question enum. (
/showthread.php?tid=572787)
Question enum. -
Baltimore - 01.05.2015
Hi !
pawn Код:
enum array
{
array1,
array2
}
It's ok.
pawn Код:
enum array
{
array1 = -1,
array2
}
It's not good, why?
I have errors
Thx
Re: Question enum. -
arlindi - 01.05.2015
Can you explain it please i dont understand you
Re: Question enum. -
Baltimore - 01.05.2015
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
}
Re: Question enum. -
arlindi - 01.05.2015
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
Re: Question enum. -
PowerPC603 - 01.05.2015
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