AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Problem with array (https://forums.alliedmods.net/showthread.php?t=153768)

Kiske 03-28-2011 21:17

[SOLVED] Problem with array
 
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.

Emp` 03-28-2011 21:21

Re: Problem with array
 
Show how you create and fill the array.

Kiske 03-28-2011 21:29

Re: Problem with array
 
Quote:

Originally Posted by Emp` (Post 1440963)
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])
        }
    }

    
// ...



Emp` 03-28-2011 22:05

Re: Problem with array
 
What is the error and what is the value of KILL_15_1_ROUND?

Kiske 03-28-2011 22:11

Re: Problem with array
 
Quote:

Originally Posted by Emp` (Post 1440974)
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



Emp` 03-28-2011 22:18

Re: Problem with array
 
From what you showed, it should be fine.

Kiske 03-28-2011 22:31

Re: Problem with array
 
Quote:

Originally Posted by Emp` (Post 1440979)
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 :shock:

meTaLiCroSS 03-28-2011 22:48

Re: Problem with array
 
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



Exolent[jNr] 03-28-2011 23:03

Re: Problem with array
 
Quote:

Originally Posted by meTaLiCroSS (Post 1440988)
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.

Kiske 03-28-2011 23:41

Re: Problem with array
 
Quote:

Originally Posted by meTaLiCroSS (Post 1440988)
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] (Post 1440993)
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.


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

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