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

Hello, anyone can help me fix this error? when i start the server, i got message this error on my server log.
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    
//OnAngkotPlayerStateChange(playerid, newstate, oldstate);
    
OnTaxiPlayerStateChange(playeridnewstateoldstate);
    if(
newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        if(
IsHaulingCar(vehicleid) != -1) {
            
HaulingCarTimer[IsHaulingCar(vehicleid)] = 0;
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
IsHaulingCar(GetPlayerVehicleID(playerid)) != -1)
        {
            
/*if(PlayerJobInfo[playerid][pjHaulingDelay] > 0) {
                RemovePlayerFromVehicle(playerid);
                new str[256];
                format(str, sizeof(str), "[Hauling]{FFFFFF} Silahkan menunggu {FFFF00}%d detik{FFFFFF} lagi, untuk menggunakan job hauling kembali", PlayerJobInfo[playerid][pjHaulingDelay]);
                return SendClientMessageEx(playerid, COLOR_LIGHTGREEN, str);
            }*/
            
if(pHaulingRoute[playerid] != -1) {
                
pHaulingTimer[playerid] = 0;
            }
            if(
pHaulingRoute[playerid] == -1) {
                
SendClientMessageEx(playeridCOLOR_LIGHTGREEN"[Hauling]{FFFFFF} Silahkan ambil muatan truk di dekat anda");
            }
        }
    }
    if(
newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
    {
        if(
pHaulingRoute[playerid] != -1) {
            
pHaulingTimer[playerid] = 15;
             
GameTextForPlayer(playerid"~y~Hauling Fail~w~~n~dalam waktu ~y~15~w~ detik"10005);
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        
OnVehicleShowroomFunction(playerid);
    }
    if(
oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
        if(
GetPVarInt(playerid"ShowroomCarEdit") == 1)
        {
            new 
GetPVarInt(playerid"ShowroomCarEdit");
            
DeletePVar(playerid"ShowroomCarEdit");
            new 
GetVehicleShowroomID(GetPlayerVehicleID(playerid));
            
SetVehiclePos(ShowroomVehicleInfo[s][v][srvId], ShowroomVehicleInfo[s][v][srvPos][0], ShowroomVehicleInfo[s][v][srvPos][1], ShowroomVehicleInfo[s][v][srvPos][2]);
            
SetVehicleZAngle(ShowroomVehicleInfo[s][v][srvId], ShowroomVehicleInfo[s][v][srvPos][3]);
        }
    }
    if(
newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVERSetPlayerArmedWeapon(playerid0);
    if(
newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        
ShowVehicleHUDForPlayer(playerid);
    }
    if(
newstate != PLAYER_STATE_DRIVER && newstate != PLAYER_STATE_PASSENGER)
    {
        
HideVehicleHUDForPlayer(playerid);
    }
    if(
newstate != 2NOPTrigger[playerid] = 0;
    if(
IsPlayerNPC(playerid))
    {
        if(
newstate == PLAYER_STATE_SPECTATING)
        {
            
TogglePlayerSpectating(playeridfalse);
        }
        return 
1;
    }
    if(
oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
        if(
IsValidObject(semnalizari[GetPVarInt(playerid"VehLamp")][0])) DestroyObject(semnalizari[GetPVarInt(playerid"VehLamp")][0]); semnalizari[GetPVarInt(playerid"VehLamp")][0] = INVALID_OBJECT_ID;
        if(
IsValidObject(semnalizari[GetPVarInt(playerid"VehLamp")][2])) DestroyObject(semnalizari[GetPVarInt(playerid"VehLamp")][2]); semnalizari[GetPVarInt(playerid"VehLamp")][2] = INVALID_OBJECT_ID;
         
semnalizareron[GetPVarInt(playerid"VehLamp")] = 0;
         
semnalizarelon[GetPVarInt(playerid"VehLamp")] = 0;
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        
ShowVehicleHUDForPlayer(playerid);
        
pvehicleid[playerid] = GetPlayerVehicleID(playerid);
        
pmodelid[playerid] = GetVehicleModel(pvehicleid[playerid]);
    }
    else { 
PHP код:
SA-MP Dedicated Server
----------------------
v0.3.DL-R1, (C)2005-2018 SA-MP Team
[10:17:38
[
10:17:38Server Plugins
[10:17:38] --------------
[
10:17:38]  Loading plugincrashdetect
[10:17:38]   CrashDetect v4.17 is OK.
[
10:17:38]   Loaded.
[
10:17:38]  Loading pluginstreamer
[10:17:38
*** 
Streamer Plugin v2.9.1 by Incognito loaded ***
[
10:17:38]   Loaded.
[
10:17:38]  Loading pluginsscanf
[10:17:38
[
10:17:38]  ===============================
[
10:17:38]       sscanf plugin loaded.     
[
10:17:38]          Version:  2.8.2        
[10:17:38]    (c2012 Alex "******" Cole  
[10:17:38]  ===============================
[
10:17:38]   Loaded.
[
10:17:38]  Loading pluginWhirlpool
[10:17:38]  
[
10:17:38]  ==================
[
10:17:38]  
[
10:17:38]   Whirlpool loaded
[10:17:38]  
[
10:17:38]  ==================
[
10:17:38]  
[
10:17:38]   Loaded.
[
10:17:38]  Loading pluginaudio
[10:17:38
*** 
Audio Plugin v0.5 R2 by Incognito loaded ***
[
10:17:38]   Loaded.
[
10:17:38]  Loading pluginCTime
[10:17:38]  
 
» CTime Library Plugin For Pawn v0.1.0 Copyright © 2011 RyDeR` 
 
[10:17:38]   Loaded.
[10:17:38]  Loading plugin: Encrypt
[10:17:38] 
[10:17:38] ______________________________________
[10:17:38]  Encrypt Plugin v0.1 loaded
[10:17:38] ______________________________________
[10:17:38]  By: Fro © Copyright <TBG> 2009-2010
[10:17:38] ______________________________________
[10:17:38]   Loaded.
[10:17:38]  Loading plugin: FileFunctions
[10:17:38]   Loaded.
[10:17:38]  Loading plugin: nativechecker
[10:17:38]   Loaded.
[10:17:38]  Loaded 9 plugins.
[10:17:38] 
[10:17:38] Ban list
[10:17:38] --------
[10:17:38]  Loaded: samp.ban
[10:17:38] 
[10:17:38] 
[10:17:38] Filterscripts
[10:17:38] ---------------
[10:17:38]   Loading filterscript 'int.amx'...
[10:17:38]   Loading filterscript 'Buttons.amx'...
[10:17:38]   Loading filterscript 'Hidegun.amx'...
[10:17:38]   Loaded 3 filterscripts.
[10:17:39]  
[10:17:39]  ======================================= 
[10:17:39]  |                                     | 
[10:17:39]  |        YSI version 1.03.0011        | 
[10:17:39]  |        By Alex "******" Cole        | 
[10:17:39]  |                                     | 
[10:17:39]  |  Checking the latest YSI version..  | 
[10:17:39]  |                                     | 
[10:17:39]  ======================================= 
[10:17:39]  
[10:17:39] -mSelection- WARNING: Failed to load list: "sagsskins.txt"
[10:17:39] *** Audio Plugin: Started TCP server on port 7777
[10:17:39] Memuat Database Business Server...
[10:17:39] Memuat Database Stock Server...
[10:17:39] CYBER: Memuat data Harga.ini ..... [SELESAI]
[10:17:39] Loading Black Market Data.....
[10:17:39] Loading Garage Data.....
[10:17:39] Memuat Database TurfWars Server...
[10:17:39] Memuat Database Event Points Server...
[10:17:39] Memuat Database Dynamic Doors Server...
[10:17:39] Memuat Database Dynamic Map Icons Server...
[10:17:39] Memuat Database House Server...
[10:17:39] Gates loaded successfully.
[10:17:39] Memuat Database Workshop Server...
[10:17:39] Buypoint Berhasil Dimuat
[10:17:39] Memuat Database Dynamic Objects Server...
[10:17:39] Memuat Database Stuff Server...
[10:17:39] Memuat Database Server Stats Server...
[10:17:39] Memuat Database Families Server...
[10:17:39] Memuat Database Points Server...
[10:17:39] Memuat Database Dynamic Objects Server...
[10:17:39] [System] Board loaded successfully.
[10:17:39] Load Dealership
[10:17:45] Memuat Database Families HQ Server...
[10:17:45] Memuat Database Motd Server...
[10:17:45] [SCRIPT] 3DTEXTDRAW LIMIT: 1024 (Static, non-streamed) | 3DTEXTDRAW COUNT: 89
[10:17:45] [SCRIPT] PICKUP LIMIT: 4096 (Static, non-streamed) | PICKUP COUNT: 57
[10:17:45] [SCRIPT] OBJECT LIMIT: 2000 (Static, non-streamed) | OBJECT COUNT: 5134
[10:17:45] 
-------------------------------------------
[10:17:45] National Life Roleplay!n
[10:17:45] Copyright © National Life Roleplay! (2018)
[10:17:45] All Rights Reserved
[10:17:45] -------------------------------------------
[10:17:45] Berhasil memulai Gamemode...
[10:17:45] Number of vehicle models: 57
[10:17:45]  
[10:17:45]  ======================================= 
[10:17:45]  |                                     | 
[10:17:45]  |   Error: Could not connect to YSI   | 
[10:17:45]  |  update server (response was 404).  | 
[10:17:45]  |                                     | 
[10:17:45]  ======================================= 
[10:17:45]  
[10:18:35] [connection] incoming connection: 192.168.100.20:62569 id: 0
[10:18:35] [join] Marsha_Catherine has joined the server (0:192.168.100.20)
[10:18:42] Marsha_Catherine has logged in.
[10:18:42] Marsha_Catherine has logged in.
[10:18:42]  Loading Marsha_Catherine's vehicles.
[10:18:42]  Loading all vehicles mods.
[10:18:42]  Loading Vehicle Object.
[10:18:44] [debug] Run time error 4: "Array index out of bounds"
[10:18:44] [debug]  Attempted to read/write array element at negative index -400
[10:18:44] [debug] AMX backtrace:
[10:18:44] [debug] #0 0015d33c in public avt_OnPlayerStateChange (0, 8, 0) from a.amx
[10:18:44] [debug] #1 00016380 in public OnPlayerStateChange (0, 8, 0) from a.amx
[10:18:44] [debug] Run time error 4: "Array index out of bounds"
[10:18:44] [debug]  Attempted to read/write array element at negative index -400
[10:18:44] [debug] AMX backtrace:
[10:18:44] [debug] #0 0015d33c in public avt_OnPlayerStateChange (0, 1, 8) from a.amx
[10:18:44] [debug] #1 00016380 in public OnPlayerStateChange (0, 1, 8) from a.amx
[10:19:52] [zcmd] [Marsha Catherine]: /aod
[10:20:00] [zcmd] [Marsha Catherine]: /gate
[10:20:01] [zcmd] [Marsha Catherine]: /hgate
[10:20:03] [zcmd] [Marsha Catherine]: /hgate 1
[10:20:06] [zcmd] [Marsha Catherine]: /hgate 
[10:20:08] [zcmd] [Marsha Catherine]: /hgate test
[10:20:11]  Unloading Marsha_Catherine's vehicles.
[10:20:11] [part] Marsha_Catherine has left the server (0:1)
[10:20:54] [connection] incoming connection: 192.168.100.20:50830 id: 0
[10:20:54] [join] Marsha_Catherine has joined the server (0:192.168.100.20) 
Reply


Messages In This Thread
Run time error 4: "Array index out of bounds" - by Richturtle - 20.04.2018, 06:45
Re: Run time error 4: "Array index out of bounds" - by Logic_ - 20.04.2018, 06:47
Re: Run time error 4: "Array index out of bounds" - by GTLS - 20.04.2018, 07:06
Re: Run time error 4: "Array index out of bounds" - by UFF - 20.04.2018, 07:22
Re: Run time error 4: "Array index out of bounds" - by Richturtle - 20.04.2018, 07:57
Re: Run time error 4: "Array index out of bounds" - by FnZ - 20.04.2018, 09:30
Re: Run time error 4: "Array index out of bounds" - by Richturtle - 25.04.2018, 09:44

Forum Jump:


Users browsing this thread: 3 Guest(s)