amx backtrace here
#1

why do i get amx backtrace here?i got no big strings or stuff...

i wasnt getting errors before i added this

PHP Code:
    if(PWarehouseCP[playerid] >= 0 && PlayerData[playerid][Job] == 2)
    {
        if(
PWarehouseCP[playerid] == 2)
        {
            
PWarehouseCP[playerid] = 10;
            new 
randn = random(sizeof(WarehouseInteriorCP));
            
SetPlayerCheckpoint(playerid, WarehouseExteriorCP[randn][0], WarehouseExteriorCP[randn][1], WarehouseExteriorCP[randn][2], 1.0);
            
SetDestination(playerid, WarehouseExteriorCP[randn][0], WarehouseExteriorCP[randn][1], WarehouseExteriorCP[randn][2]);
            return 
1;
        }
        if(
PWarehouseCP[playerid] == 10)
        {   
            
PWarehouseCurrent[playerid] ++;
            
PWarehouseCP[playerid] = 2;
            new 
randn = random(sizeof(WarehouseExteriorCP));
            
SetPlayerCheckpoint(playerid, WarehouseInteriorCP[randn][0], WarehouseInteriorCP[randn][1], WarehouseInteriorCP[randn][2], 1.0);
            
SetDestination(playerid, WarehouseInteriorCP[randn][0], WarehouseInteriorCP[randn][1], WarehouseInteriorCP[randn][2]);
            return 
1;
        }
        if(
PWarehouseCurrent[playerid] == 10)
        {
            
SendClientMessage(playerid, COLOR_WHITE, "test");
            
PWarehouseCP[playerid] = 0;
            
PWarehouseCurrent[playerid] = 0;
            
IsWorking[playerid] = 0;
            return 
1;
        }
        return 
1;
    } 
log:
PHP Code:
[00:45:26] [debug] Run time error 4: "Array index out of bounds"
[00:45:26] [debug]  Accessing element at index 30 past array upper bound 10
[00:45:26] [debug] AMX backtrace:
[
00:45:26] [debug] #0 0007da68 in ?? (0) from serverteste.amx
[00:45:26] [debug] #1 00008504 in public OnPlayerEnterCheckpoint (0) from serverteste.amx 
PHP Code:
PWarehouseCurrent[MAX_PLAYERS]; 
PHP Code:
PWarehouseCP[MAX_PLAYERS]; 
Reply
#2

Replace this
Code:
new randn = random(sizeof(WarehouseExteriorCP));
Whit this.
Code:
new randn = random(sizeof(WarehouseInteriorCP));
Hope i helped u.
Reply
#3

Quote:
Originally Posted by kingmk
View Post
Replace this
Code:
new randn = random(sizeof(WarehouseExteriorCP));
Whit this.
Code:
new randn = random(sizeof(WarehouseInteriorCP));
Hope i helped u.
thanks buddy ! +repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)