View Single Post
Author Message
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death"
Old 05-08-2012 , 15:54   [SOLVED] Array Question
Reply With Quote #1

Hello

Today, I'm looking to create an array with 'default value' (don't know how to say that in English ><)

I saw this post: http://forums.alliedmods.net/showthread.php?t=182348&

but I don't understand I tested this:

PHP Code:
enum AnEnum

    
AnEnum_FirstValue 5000,
    
AnEnum_SecondValue 6000,
    
AnEnum_ThirdValue 8000,
};

new 
g_var[AnEnum];

// ...


// in a test command:     
PrintToChatAll("test 2 first:%i second:%i third:%i",g_var[AnEnum_FirstValue],g_var[AnEnum_SecondValue],g_var[AnEnum_ThirdValue]); 
return:
test 2 first:0 second:0 third:0


how can can I return the value in the enum ? (5000,6000,8000) ?

thx
__________________
Sorry for my bad English, I'm Belgian

Last edited by Razmo51; 05-09-2012 at 10:37.
Razmo51 is offline