Run time error 4: "Array index out of bounds"
#1

pawn Код:
[13:45:48] [debug] Run time error 4: "Array index out of bounds"
[13:45:48] [debug]   Accessing element at index 3 past array upper bound 2
[13:45:48] [debug] Backtrace (most recent call first):
[13:45:48] [debug] #0  public OnPlayerPickUpStreamPickup()+0x22d4 from GJ.amx
[13:45:48] [debug] #1  public OnPlayerPickUpDynamicPickup()+0x20 from GJ.amx
[13:45:48] [debug] #2  native Streamer_CallbackHook() from streamer.DLL
[13:45:48] [debug] #3  0x00000000()+0x292e0 from GJ.amx
pawn Код:
public OnPlayerPickUpStreamPickup(playerid,pickupid)
{
    for(new h = 0; h < sizeof(FamilyInfo); h++)
    {
        if(pickupid == FamilyInfo[h][PickupID])
        {
            if(FamilyInfo[h][FamilySafe] == 1)
            {
                GameTextForPlayer(playerid, "~b~Family Locker~n~~w~Type ~r~/flocker~w~ to store items", 5000, 3);
            }
            return 1;
        }
    }
    for(new i = 0; i < sizeof(Restaurants);i++)
    {
        if(PlayerToPoint(2,playerid,
            Restaurants[i][rest_x],
            Restaurants[i][rest_y],
            Restaurants[i][rest_z]
        ))
        {
            LastUsedEntrance[playerid] = gettime();
            SetPlayerPos(playerid,377.0800,-192.9900,1000.6410);
            SetPlayerFacingAngle(playerid,0.0);
            SetPlayerInterior(playerid,17);
            SetPlayerVirtualWorld(playerid,i);
            return 1;
        }
    }

    return 1;
}
pawn Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    OnPlayerPickUpStreamPickup(playerid, pickupid);
    return 1;
}
Reply
#2

Is this from an include that you've downloaded?
Reply
#3

Server log
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)