AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Array must be indexed (Array inside Array?) (https://forums.alliedmods.net/showthread.php?t=276513)

redivcram 12-22-2015 17:57

Array must be indexed (Array inside Array?)
 
Edit: Solved

Error:
Code:

error 033: array must be indexed (variable "gLEVELS")
PHP Code:

new const gLEVELS[10]/*[]*/ = {
    
0
    
10
    
20
    
30
    
40
    
50
    
60
    
70
    
80
    
90


PHP Code:

while(gPL_XP[attacker] >= /*>>*/gLEVELS[gPL_LVL[attacker]]/*<<*/

It's already indexed with an indexed array?!

Bugsy 12-22-2015 18:07

Re: Array must be indexed (Array inside Array?)
 
You are saying it's a 2-dimension ([][]) array but defining it as 1-dimension ([]).

Do
new const gLEVELS[10]
or
new const gLEVELS[]

redivcram 12-22-2015 18:51

Re: Array must be indexed (Array inside Array?)
 
Thx

I'll report to that thread about arrays you made I think.


All times are GMT -4. The time now is 18:12.

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