Raised This Month: $ Target: $400
 0% 

[SOLVED] Problem with array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kiske
Veteran Member
Join Date: May 2009
Old 03-28-2011 , 21:17   [SOLVED] Problem with array
Reply With Quote #1

I have an warning (tag mismatch) with this code:

PHP Code:
new i_Reward ArrayGetCell(A_REWARD_POINTS[REWARD_HUMAN], KILL_15_1_ROUND
The array is an int.
__________________


Last edited by Kiske; 03-28-2011 at 22:11.
Kiske is offline
Send a message via Skype™ to Kiske
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-28-2011 , 21:21   Re: Problem with array
Reply With Quote #2

Show how you create and fill the array.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
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
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-28-2011 , 22:05   Re: Problem with array
Reply With Quote #4

What is the error and what is the value of KILL_15_1_ROUND?
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Kiske
Veteran Member
Join Date: May 2009
Old 03-28-2011 , 22:11   Re: Problem with array
Reply With Quote #5

Quote:
Originally Posted by Emp` View Post
What is the error and what is the value of KILL_15_1_ROUND?
Is a warning (tag mismatch).

And the value of the KILL_15_1_ROUND is six:
PHP Code:
enum
{
    
FULL_HAB_H 0,
    
COMBO_2500,
    
KILL_20000,
    
KILL_50000,
    
KILL_100000,
    
RESET,
    
KILL_15_1_ROUND,
    
KILL_25_1_ROUND

__________________

Kiske is offline
Send a message via Skype™ to Kiske
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-28-2011 , 22:18   Re: Problem with array
Reply With Quote #6

From what you showed, it should be fine.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Kiske
Veteran Member
Join Date: May 2009
Old 03-28-2011 , 22:31   Re: Problem with array
Reply With Quote #7

Quote:
Originally Posted by Emp` View Post
From what you showed, it should be fine.
=(

Now i test this, look to:

PHP Code:
new i_Reward ArrayGetCell(A_REWARD_POINTS[REWARD_HUMAN], KILL_15_1_ROUND
PHP Code:
new i_Reward ArrayGetCell(A_REWARD_POINTS[0], 6
and with the second code i dont have any warning
__________________


Last edited by Kiske; 03-29-2011 at 08:19.
Kiske is offline
Send a message via Skype™ to Kiske
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 03-28-2011 , 22:48   Re: Problem with array
Reply With Quote #8

Try:

PHP Code:
enum _:SHIT
{
    
FULL_HAB_H 0,
    
COMBO_2500,
    
KILL_20000,
    
KILL_50000,
    
KILL_100000,
    
RESET,
    
KILL_15_1_ROUND,
    
KILL_25_1_ROUND

__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-28-2011 , 23:03   Re: Problem with array
Reply With Quote #9

Quote:
Originally Posted by meTaLiCroSS View Post
Try:

PHP Code:
enum _:SHIT
{
    
FULL_HAB_H 0,
    
COMBO_2500,
    
KILL_20000,
    
KILL_50000,
    
KILL_100000,
    
RESET,
    
KILL_15_1_ROUND,
    
KILL_25_1_ROUND

That won't change a thing.

@Kiske
Show where LOGRO_HUMAN is defined.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Kiske
Veteran Member
Join Date: May 2009
Old 03-28-2011 , 23:41   Re: Problem with array
Reply With Quote #10

Quote:
Originally Posted by meTaLiCroSS View Post
Try:

PHP Code:
enum _:SHIT
{
    
FULL_HAB_H 0,
    
COMBO_2500,
    
KILL_20000,
    
KILL_50000,
    
KILL_100000,
    
RESET,
    
KILL_15_1_ROUND,
    
KILL_25_1_ROUND

Nothing


Quote:
Originally Posted by Exolent[jNr] View Post
That won't change a thing.

@Kiske
Show where LOGRO_HUMAN is defined.
Sorry, i change the name after the post and when i copy and paste i forget that i have to change to the old name for you to understand it.
Edited.
__________________


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



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