Array index out of bounds.
#1

I usually have alot of problems with this kind, i thought lets ask help to solve one of them and ill the rest my self.


PHP код:
if(Player[playerid][PlayerGang] != -&& !IsPlayerNPC(playerid))
            {
                new 
zone Gang[Player[playerid][PlayerGang]][CurrentZone];    
                if(
GangZone[zone][ZoneStatus] == true && GangZone[zone][ZoneOwner] == Player[playerid][PlayerGang])
                {
                    new 
msg1[128];
                    
format(msg1sizeof(msg1), "{FF0000}** %s gang failed to capture %s zone, REASON: Oppenent Gang reached to rescue!"Gang[Player[playerid][PlayerGang]][GangName], GangZone[zone][ZoneName]);
                    
SendClientMessageToAll(-1msg1);
                    
Gang[Player[playerid][PlayerGang]][CurrentZone] = -1;
                    
GangZone[zone][ZoneLocked] = GetTickCount();
                    
GangZone[zone][ZoneStatus] = false;
                    
GangZoneStopFlashForAll(GangZone[zone][ZoneHolder]);            
                }
            } 
This is the code to check, if player is capturing zone, while doing that the zone owner comes into zone, the capturing status fails and zone gets locked...

This that is under onplayerenter area, and i am getting this in debug when player enters a area:

PHP код:
[debugRun time error 4"Array index out of bounds"
[debug]  Accessing element at negative index -1
[debugAMX backtrace:
[
debug#0 00055d98 in public S@@_OnPlayerEnterArea (playerid=1, areaid=27) at C:\Users\iLearner\Desktop\ffss\pawno\include\FFS/FFS_gangs.inc:1250
[debug#1 0000cb00 in Area_AddCuboid (... <2 variable arguments>) at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_hooks/impl.inc:2502
[debug#2 native CallRemoteFunction () [00471b40] from samp-server.exe
[debug#3 00024c9c in Area_DoEnter (playerid=1, areaid=27, &idx=@0x020f41d0) at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_areas.inc:2770
[debug#4 00020c6c in bool:Area_AddCuboid (... <1 variable argument>) at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_areas.inc:2110
[debug#5 0000b954 in Area_AddCuboid (... <1 variable argument>) at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_hooks/impl.inc:1997 
Additional information:
Line given in warnings:
PHP код:
                if(GangZone[zone][ZoneStatus] == true && GangZone[zone][ZoneOwner] == Player[playerid][PlayerGang]) 
Reply


Messages In This Thread
Array index out of bounds. - by iLearner - 14.12.2016, 16:57
Re: Array index out of bounds. - by Threshold - 14.12.2016, 17:08
Re: Array index out of bounds. - by iLearner - 14.12.2016, 17:09
Re: Array index out of bounds. - by Threshold - 14.12.2016, 17:15
Re: Array index out of bounds. - by iLearner - 14.12.2016, 18:19
Re: Array index out of bounds. - by Pottus - 14.12.2016, 18:24
Re: Array index out of bounds. - by Konstantinos - 14.12.2016, 18:24
Re: Array index out of bounds. - by iLearner - 14.12.2016, 18:44

Forum Jump:


Users browsing this thread: 1 Guest(s)