enum-array
#1

Hi,

Simple variable

new Variable[ MAX_PLAYERS ];

is enum-array? or i need to create enum then that variable will by enum-array?
Reply
#2

you need to create enum.
Example:
PHP код:
enum E_MY_ARRAY
{
    
E_MY_ARRAY_MONEY,
    
E_MY_ARRAY_AMMO,
    
E_MY_ARRAY_GUN
}
 
new
    
gPlayerData[MAX_PLAYERS][E_MY_ARRAY];
 
public 
OnPlayerConnect(playerid)
{
    
gPlayerData[playerid][E_MY_ARRAY_MONEY] = 0;
    
gPlayerData[playerid][E_MY_ARRAY_AMMO] = 100;
    
gPlayerData[playerid][E_MY_ARRAY_GUN] = 5;
}
//I prefer Enum array but you can create simple variable like
new money[MAX_PLAYERS]; 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)