Raised This Month: $ Target: $400
 0% 

[SOLVED] Problem with array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Kiske
Veteran Member
Join Date: May 2009
Old 03-28-2011 , 21:29   Re: Problem with array
Reply With Quote #3

Quote:
Originally Posted by Emp` View Post
Show how you create and fill the array.
Ok.

PHP Code:
enum
{
    
REWARD_HUMAN 0,
    
REWARD_ZOMBIE,

    
MAX_CLASS
}
#define MAX_HUMANS_LOGROS    8

new const LOGROS_REWARD_POINTS[MAX_CLASS][MAX_HUMANS_LOGROS] = 
{
    {
        
500,
        
25,
        
200,
        
500,
        
1000,
        
15,
        
15,
        
25
    
},
    {
        
500,
        
100,
        
300,
        
1000,
        
0,
        
0,
        
0,
        
0
    
}
}

new Array:
A_REWARD_POINTS[MAX_CLASS];

public 
plugin_precache()
{
    
// ...

    
for(new 0MAX_CLASSa++)
    {
        
A_REWARD_POINTS[a] = ArrayCreate(11)
    }

    for(new 
0MAX_CLASSa++)
    {
        for(new 
0MAX_HUMANS_LOGROSb++)
        {
            
ArrayPushCell(A_REWARD_POINTS[a], LOGROS_REWARD_POINTS[a][b])
        }
    }

    
// ...

__________________


Last edited by Kiske; 03-28-2011 at 21:33.
Kiske is offline
Send a message via Skype™ to Kiske
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode