Raised This Month: $52 Target: $400
 13% 

Solved error 032: array index out of bounds (variable "color3")


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 01-03-2019 , 03:42   error 032: array index out of bounds (variable "color3")
Reply With Quote #1

I'm trying to compile the amxx plugin against amxx 1.9 and this is the error message I get:
Code:
AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Header size:           2800 bytes
Code size:            29328 bytes
Data size:            50832 bytes
Stack/heap size:      16384 bytes
Total requirements:   99344 bytes
Done.
AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

hlstatsx_commands_cstrike.sma(865) : error 032: array index out of bounds (variable "color3")
hlstatsx_commands_cstrike.sma(926) : error 032: array index out of bounds (variable "color3")

2 Errors.
Could not locate output file compiled/hlstatsx_commands_cstrike.amx (compile failed).
How to fix this?
Attached Files
File Type: sma Get Plugin or Get Source (hlstatsx_commands_cstrike.sma - 276 views - 39.1 KB)
__________________


Last edited by Mordekay; 01-06-2019 at 08:35.
Mordekay is offline
NomisCZ
AlliedModders Donor
Join Date: Mar 2014
Location: $this->Czech_Republic
Old 01-03-2019 , 04:44   Re: error 032: array index out of bounds (variable "color3")
Reply With Quote #2

Hi,
this section is only for Sourcemod plugins.

-> AMX: https://forums.alliedmods.net/forumdisplay.php?f=3
__________________



Steam: NomisCZ
NomisCZ is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 01-03-2019 , 04:56   Re: error 032: array index out of bounds (variable "color3")
Reply With Quote #3

This section is for everything related to hlxstats, so i'm in the correct section.
__________________

Mordekay is offline
NomisCZ
AlliedModders Donor
Join Date: Mar 2014
Location: $this->Czech_Republic
Old 01-04-2019 , 08:40   Re: error 032: array index out of bounds (variable "color3")
Reply With Quote #4

Maybe there is a problem with array declaration. In Pawn documentation is example:
PHP Code:
new Numbers[4] = {0,1,2,3}
So new color3[0][] = {255255255is probably wrong
Try to rewrite line 862 to:

PHP Code:
new color3[3] = {255255255}; 
and line 865 to:
PHP Code:
set_hudmessage(color3[0], color3[1], color3[2], -1.0verpos06.06.00.50.15, -1
PHP Code:
public hlx_amx_csay(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED
    
    
static message[192]
    
read_args(message191)
    
remove_quotes(message)
    
    new 
color3[3] = {255255255}
    new 
Float:verpos 0.3
    
    set_hudmessage
(color3[0], color3[1], color3[2], -1.0verpos06.06.00.50.15, -1)
    
show_hudmessage(0"%s"message)

    return 
PLUGIN_HANDLED

__________________



Steam: NomisCZ

Last edited by NomisCZ; 01-04-2019 at 08:42.
NomisCZ is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 01-04-2019 , 17:23   Re: error 032: array index out of bounds (variable "color3")
Reply With Quote #5

Still does not compile:
Code:
AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

hlstatsx_commands_cstrike.sma(926) : error 032: array index out of bounds (variable "color3")

1 Error.
Could not locate output file compiled/hlstatsx_commands_cstrike.amx (compile failed).
__________________

Mordekay is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-05-2019 , 19:20   Re: error 032: array index out of bounds (variable "color3")
Reply With Quote #6

Code:
new color3[0][] = {255, 255, 255}
to

Code:
new color3[3] = {255, 255, 255}
Then on code use color3[0], color3[1], color3[2]

Or if you're out of patience, change color3 [] [] by, 255, 255, 255 manually.
__________________

Last edited by iceeedr; 01-05-2019 at 19:25.
iceeedr is offline
Send a message via Skype™ to iceeedr
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 01-06-2019 , 03:35   Re: error 032: array index out of bounds (variable "color3")
Reply With Quote #7

Sorry, i'm not out of patience, but i have no idea what you are talking about as i have no idea about scripting at all.
I have replaced the line you posted and tried to compile, it failed. Then i changed the line
Code:
set_hudmessage(color3[0][0], color3[0][1], color3[0][2], -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
to
Code:
set_hudmessage(color3[[0], color3[1], color3[2], -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
which gives me this
Code:
AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

hlstatsx_commands_cstrike.sma(926) : error 032: array index out of bounds (variable "color3")

1 Error.
Could not locate output file compiled/hlstatsx_commands_cstrike.amx (compile failed).
As said: I have no idea about coding, so a complete list of lines and how to change them is needed and greatly appreciated.
__________________

Mordekay is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-06-2019 , 03:51   Re: error 032: array index out of bounds (variable "color3")
Reply With Quote #8

The problem seems to be that the original color3 array is declared with a size of zero (i.e. it doesn't exist) which apparently is fixed by the older compiler.

Since you don't know about coding, the easiest way to fix this is to go back to the original and change this:

Code:
new color3[0][]
to this:

Code:
new color3[1][]

Note that this part was poorly coded originally and there is a better solution but since you're unfamiliar with coding this should be the easiest change for you to make and it should function correctly.

P.S. I have not tested with the AMX Mod X 1.9.0 compiler since I'm not using that version.
__________________

Last edited by fysiks; 01-06-2019 at 03:53.
fysiks is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 01-06-2019 , 04:05   Re: error 032: array index out of bounds (variable "color3")
Reply With Quote #9

If i change it like this in the original .sma I got this:
Code:
AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

hlstatsx_commands_cstrike.sma(862) : error 018: initialization data exceeds declared size
hlstatsx_commands_cstrike.sma(862) : warning 215: expression has no effect
hlstatsx_commands_cstrike.sma(862) : warning 215: expression has no effect
hlstatsx_commands_cstrike.sma(862) : error 001: expected token: ";", but found "}"
hlstatsx_commands_cstrike.sma(862) : warning 209: function "hlx_amx_csay" should return a value
hlstatsx_commands_cstrike.sma(865) : error 021: symbol already defined: "set_hudmessage"
hlstatsx_commands_cstrike.sma(868) : error 010: invalid function or declaration
hlstatsx_commands_cstrike.sma(926) : error 032: array index out of bounds (variable "color3")
hlstatsx_commands_cstrike.sma(865) : warning 203: symbol is never used: "verpos"

5 Errors.
Could not locate output file compiled/hlstatsx_commands_cstrike.amx (compile failed).
__________________


Last edited by Mordekay; 01-06-2019 at 04:12.
Mordekay is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-06-2019 , 05:35   Re: error 032: array index out of bounds (variable "color3")
Reply With Quote #10

Spoiler
__________________
HamletEagle is offline
Reply


Thread Tools
Display Modes

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 23:28.


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