Array index out of bound?
#1

Oke, I thought it was solved after somebody mentioned a closing ')', but it's not.

Code:

pawn Код:
for(new biz = 0; biz < MAX_BIZ; biz++) // For entering a business
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[biz][XCoord], BizInfo[biz][YCoord], BizInfo[ZCoord]) && PlayerInfo[playerid][pVW] == 0) // ERROR ON THIS LINE
        {
            new string25[150];
            format(string25,sizeof(string25),"Welcome to %s!", BizInfo[biz][Name]);
            SetPlayerVirtualWorld(playerid, BizInfo[biz][VW]);
            PlayerInfo[playerid][pVW] = BizInfo[biz][VW];
            PlayerInfo[playerid][pInt] = BizInfo[biz][VW];
            PlayerInfo[playerid][pLocal] = BizInfo[biz][VW];
            SetPlayerInterior(playerid, BizInfo[biz][Int]);
            SetPlayerPos(playerid, BizInfo[biz][IXCoord], BizInfo[biz][IYCoord], BizInfo[biz][IZCoord]);
            SendClientMessage(playerid, COLOR_LIGHTGREEN, string25);
        }
    }
My errors:

Код:
C:\Program Files\GTA San Andreas (2)\server\FGRP\gamemodes\FGRP - Copy.pwn(36668) : error 032: array index out of bounds (variable "BizInfo")
C:\Program Files\GTA San Andreas (2)\server\FGRP\gamemodes\FGRP - Copy.pwn(89426) : warning 203: symbol is never used: "IsAtAMMU"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Tried to change MAX_BIZ as somebody said, but that didn't work.
Reply
#2

Your MAX_BIZ is too short, increase it.
Reply
#3

You forgot the closing parenthesis in the IsPlayerInRangeOfPoint
Reply
#4

No luck. Changed it way too high, but still the error. Normally I set it to 100 and it worked fine on my other script. But when I'm implenting it to my main script I get that error.

EDIT: omfg, I'm so stupid. Thank you.
EDIT2: lol, I thought it was fixed by adding the ')', but it's not. HELP!
EDIT3: I'm a retard. I've put BizInfo[ZCoord] instead of BizInfo[biz][ZCoord]. Solved!
Reply
#5

change this:
Код:
BizInfo[biz][YCoord], BizInfo[ZCoord]
to:
Код:
BizInfo[biz][YCoord], BizInfo[biz][ZCoord]
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)