PDA

View Full Version : [HELP][+REP] error 032: array index out of bounds


McOwens
20/01/2015, 09:48 PM
please help i got 3 error of those [+REP] ( for the one who help me )
(11077) : error 032: array index out of bounds (variable "PlayerTemp")
(32494) : error 032: array index out of bounds (variable "PlayerTemp")
(32496) : error 032: array index out of bounds (variable "PlayerTemp")
================================================== ==============
(11077) PlayerTemp[playerid][afrozen] = 0;
(32494) PlayerTemp[playerid][afrozen] = 1;
(32496) PlayerTemp[playerid][afrozen] = 0;

DavidSparks
20/01/2015, 09:58 PM
Can you show us the whole command / variable?

McOwens
20/01/2015, 10:00 PM
forward TogglePlayerControllableEx(playerid,controllable);
public TogglePlayerControllableEx(playerid,controllable)
{
TogglePlayerControllable(playerid,controllable);
if (controllable == 0)
PlayerTemp[playerid][afrozen] = 1;
else if (controllable == 1)
PlayerTemp[playerid][afrozen] = 0;
return 1;
}

DavidSparks
20/01/2015, 10:03 PM
Do you have a enum called PlayerTemp or smthing like that?

McOwens
20/01/2015, 10:06 PM
no :(

xVIP3Rx
20/01/2015, 10:16 PM
You surly have it, an enum "PlayerTemp"

McOwens
20/01/2015, 10:25 PM
i've worked with it in alot of things and it works fine,but this is not. :(

Saize
21/01/2015, 12:24 AM
forward TogglePlayerControllableEx(playerid,controllable);
public TogglePlayerControllableEx(playerid,controllable)
{
TogglePlayerControllable(playerid,controllable);
if (controllable == 0) return PlayerTemp[playerid][afrozen] = 1;
else (controllable == 1) return PlayerTemp[playerid][afrozen] = 0;

return 1;
}

Try it like this Maybe

I think theirs no need to use else if, but if its not working with else then just write the if by yourself :)


If it keeps giving you the warnings, then could you send us the line where you define that var? (or the whole enum)