SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/02/2018, 09:55 PM   #1
PepsiCola23
Gangsta
 
Join Date: May 2015
Posts: 728
Reputation: 3
Default amx backtrace here

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] >= && PlayerData[playerid][Job] == 2)
    {
        if(
PWarehouseCP[playerid] == 2)
        {
            
PWarehouseCP[playerid] = 10;
            new 
randn random(sizeof(WarehouseInteriorCP));
            
SetPlayerCheckpoint(playeridWarehouseExteriorCP[randn][0], WarehouseExteriorCP[randn][1], WarehouseExteriorCP[randn][2], 1.0);
            
SetDestination(playeridWarehouseExteriorCP[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(playeridWarehouseInteriorCP[randn][0], WarehouseInteriorCP[randn][1], WarehouseInteriorCP[randn][2], 1.0);
            
SetDestination(playeridWarehouseInteriorCP[randn][0], WarehouseInteriorCP[randn][1], WarehouseInteriorCP[randn][2]);

            return 
1;
        }
        if(
PWarehouseCurrent[playerid] == 10)
        {
            
SendClientMessage(playeridCOLOR_WHITE"test");
            
PWarehouseCP[playerid] = 0;
            
PWarehouseCurrent[playerid] = 0;
            
IsWorking[playerid] = 0;

            return 
1;
        }
        return 
1;
    } 
log:
PHP Code:
[00:45:26] [debugRun 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] [debugAMX 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]; 
PepsiCola23 is offline   Reply With Quote
Old 23/02/2018, 09:58 PM   #2
kingmk
Big Clucker
 
kingmk's Avatar
 
Join Date: Sep 2014
Location: Romania
Posts: 99
Reputation: 22
Default Re: amx backtrace here

Replace this
Code:
new randn = random(sizeof(WarehouseExteriorCP));
Whit this.
Code:
new randn = random(sizeof(WarehouseInteriorCP));
Hope i helped u.
__________________
Follow me on YouTube:
Click
If u need help don't hesitate to PM me.
X-BURN COMMUNITY

kingmk is offline   Reply With Quote
Old 23/02/2018, 10:00 PM   #3
PepsiCola23
Gangsta
 
Join Date: May 2015
Posts: 728
Reputation: 3
Default Re: amx backtrace here

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
PepsiCola23 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AMX Backtrace PepsiCola23 Scripting Help 0 09/02/2018 11:36 AM
AMX Backtrace pulsare Server Support 3 21/01/2018 03:01 PM
AMX Backtrace [+Rep] RayC Scripting Help 2 04/01/2015 07:51 PM
AMX backtrace Youssef221 Scripting Help 1 13/11/2014 04:57 PM


All times are GMT. The time now is 04:56 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.