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

PHP код:
----------
Loaded log file"server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.DL-R1, (C)2005-2018 SA-MP Team
[21:51:28
[
21:51:28Server Plugins
[21:51:28] --------------
[
21:51:28]  Loading plugincrashdetect
[21:51:28]   CrashDetect v4.17 is OK.
[
21:51:28]   Loaded.
[
21:51:28]  Loading pluginstreamer
[21:51:28
*** 
Streamer Plugin v2.9.1 by Incognito loaded ***
[
21:51:28]   Loaded.
[
21:51:28]  Loading pluginsscanf
[21:51:28
[
21:51:28]  ===============================
[
21:51:28]       sscanf plugin loaded.     
[
21:51:28]          Version:  2.8.2        
[21:51:28]    (c2012 Alex "******" Cole  
[21:51:28]  ===============================
[
21:51:28]   Loaded.
[
21:51:28]  Loading pluginaudio
[21:51:28
*** 
Audio Plugin v0.5 R2 by Incognito loaded ***
[
21:51:28]   Loaded.
[
21:51:28]  Loading pluginWhirlpool
[21:51:28]  
[
21:51:28]  ==================
[
21:51:28]  
[
21:51:28]   Whirlpool loaded
[21:51:28]  
[
21:51:28]  ==================
[
21:51:28]  
[
21:51:28]   Loaded.
[
21:51:28]  Loading pluginnativechecker
[21:51:28]   Loaded.
[
21:51:28]  Loaded 6 plugins.
[
21:51:28
[
21:51:28Ban list
[
21:51:28] --------
[
21:51:28]  Loadedsamp.ban
[21:51:28
[
21:51:28
[
21:51:28Filterscripts
[21:51:28] ---------------
[
21:51:28]   Loading filterscript 'int.amx'...
[
21:51:28]   Loading filterscript 'Buttons.amx'...
[
21:51:29]   Loaded 2 filterscripts.
[
21:51:29]  
[
21:51:29]  ======================================= 
[
21:51:29]  |                                     | 
[
21:51:29]  |        YSI version 1.03.0011        
[
21:51:29]  |        By Alex "******" Cole        
[
21:51:29]  |                                     | 
[
21:51:29]  |  Checking the latest YSI version..  | 
[
21:51:29]  |                                     | 
[
21:51:29]  ======================================= 
[
21:51:29]  
[
21:51:29] *** Audio PluginStarted TCP server on port 7777
[21:51:29Memuat Database Business Server...
[
21:51:29Memuat Database Stock Server...
[
21:51:29CYBERMemuat data Harga.ini ..... [SELESAI]
[
21:51:29Loading Black Market Data.....
[
21:51:29Loading Garage Data.....
[
21:51:29Memuat Database TurfWars Server...
[
21:51:29Memuat Database Event Points Server...
[
21:51:29Memuat Database Dynamic Doors Server...
[
21:51:29Memuat Database Dynamic Map Icons Server...
[
21:51:29Memuat Database House Server...
[
21:51:29Gates loaded successfully.
[
21:51:29Memuat Database Workshop Server...
[
21:51:29Buypoint Berhasil Dimuat
[21:51:29Memuat Database Dynamic Objects Server...
[
21:51:29Memuat Database Stuff Server...
[
21:51:29Memuat Database Server Stats Server...
[
21:51:29Memuat Database Families Server...
[
21:51:29Memuat Database Points Server...
[
21:51:29Memuat Database Dynamic Objects Server...
[
21:51:29] [SystemBoard loaded successfully.
[
21:51:29Load Dealership
[21:51:34Memuat Database Families HQ Server...
[
21:51:34Memuat Database Motd Server...
[
21:51:34] [SCRIPT3DTEXTDRAW LIMIT1024 (Static, non-streamed) | 3DTEXTDRAW COUNT101
[21:51:34] [SCRIPTPICKUP LIMIT4096 (Static, non-streamed) | PICKUP COUNT66
[21:51:34] [SCRIPTOBJECT LIMIT1000 (Static, non-streamed) | OBJECT COUNT6056
[21:51:34
-------------------------------------------
[
21:51:34National Life Project Roleplay
[21:51:34Copyright (CNational Life Project RoleplayLLC (2018)
[
21:51:34All Rights Reserved
[21:51:34] -------------------------------------------
[
21:51:34Berhasil memulai Gamemode...
[
21:51:34Number of vehicle models57
[21:51:34]  
[
21:51:34]  ======================================= 
[
21:51:34]  |                                     | 
[
21:51:34]  |   ErrorCould not connect to YSI   
[
21:51:34]  |  update server (response was 404).  | 
[
21:51:34]  |                                     | 
[
21:51:34]  ======================================= 
[
21:51:34]  
[
21:51:54] [connectionincoming connection192.168.0.3:60560 id0
[21:51:54] [joinLance_Hatteberg has joined the server (0:192.168.0.3)
[
21:52:02Lance_Hatteberg has logged in.
[
21:52:02Lance_Hatteberg has logged in.
[
21:52:02]  Loading Lance_Hatteberg's vehicles.
[21:52:02]  Loading all vehicles mods.
[21:52:02]  Loading Vehicle Object.
[21:52:02] [debug] Run time error 4: "Array index out of bounds"
[21:52:02] [debug]  Attempted to read/write array element at negative index -400
[21:52:02] [debug] AMX backtrace:
[21:52:02] [debug] #0 0015d49c in public avt_OnPlayerStateChange (0, 8, 0) from Roleplay.amx
[21:52:02] [debug] #1 00016380 in public OnPlayerStateChange (0, 8, 0) from Roleplay.amx
[21:52:02] [debug] Run time error 4: "Array index out of bounds"
[21:52:02] [debug]  Attempted to read/write array element at negative index -400
[21:52:02] [debug] AMX backtrace:
[21:52:02] [debug] #0 0015d49c in public avt_OnPlayerStateChange (0, 1, 8) from Roleplay.amx
[21:52:02] [debug] #1 00016380 in public OnPlayerStateChange (0, 1, 8) from Roleplay.amx 
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 {
        
pvehicleid[playerid] = 0;
        
pmodelid[playerid] = 0;
    }
    if(
GettingSpectated[playerid] != 999)
    {
        new 
spectator GettingSpectated[playerid];
        if(!
IsPlayerConnected(spectator))
        {
            
GettingSpectated[playerid] = 999;
            
Spectate[spectator] = 999;
        }
        if(
newstate == PLAYER_STATE_DRIVER && PlayerInfo[spectator][pAdmin] >= || newstate == PLAYER_STATE_PASSENGER && PlayerInfo[spectator][pAdmin] >= 1)
        {
            
TogglePlayerSpectating(spectatortrue);
            new 
carid GetPlayerVehicleIDplayerid );
            
PlayerSpectateVehiclespectatorcarid );
            
SetPVarInt(spectator"SpecState"newstate);
        }
        else if(
newstate == PLAYER_STATE_ONFOOT && PlayerInfo[spectator][pAdmin] >= 1)
        {
            
TogglePlayerSpectating(spectatortrue);
            
PlayerSpectatePlayerspectatorplayerid );
            
SetPlayerInteriorspectatorGetPlayerInteriorplayerid ) );
            
SetPVarInt(spectator"SpecState"newstate);
        }
    }
    if(
newstate == PLAYER_STATE_ONFOOT)
    {
        if(
Audio_IsClientConnected(playerid))
        {
            
Audio_Stop(playeridstationidp[playerid]);
            
stationidp[playerid] = 0;
        }
        new 
spectator GettingSpectated[playerid];
        if(
PlayerInfo[spectator][pAdmin] >= 1) {
            
// Preventing possible buffer overflows with the arrays
            
TogglePlayerSpectating(spectatortrue);
            
PlayerSpectatePlayerspectatorplayerid );
            
SetPlayerInteriorspectatorGetPlayerInteriorplayerid ) );
            
SetPVarInt(spectator"SpecState"newstate);
            
SetPlayerInteriorspectatorGetPlayerInteriorplayerid ) );
            
SetPlayerVirtualWorldspectatorGetPlayerVirtualWorldplayerid ) );
        }
        if(
oldstate == PLAYER_STATE_DRIVER)
        {
            
SetPlayerWeaponsEx(playerid);
        }
        else if(
oldstate == PLAYER_STATE_PASSENGERSetPlayerWeaponsEx(playerid);
        if(
ConnectedToPC[playerid] == 1337)//mdc
        
{
            
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* You are now logged off the MDC.");
            
ConnectedToPC[playerid] = 0;
        }
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
    }
    if(
newstate == PLAYER_STATE_PASSENGER// TAXI & BUSSES
    
{
         if(
stationidv[GetPlayerVehicleID(playerid)] != 0)
        {
            new 
station[64];
            switch(
stationidv[GetPlayerVehicleID(playerid)])
            {
                case 
1format(stationsizeof(station), "http://216.246.109.162:8000");
                case 
2format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
                case 
3format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
                case 
4format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628721");
                case 
5format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283687");
                case 
6format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628932");
                case 
7format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1756658");
                case 
8format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
                case 
9format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057197");
                case 
10format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=18695");
                case 
11format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
                case 
12format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=181367");
                case 
13format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275071");
                case 
14format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
                case 
15format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
                case 
16format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1279013");
                case 
17format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1281016");
                case 
18format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280855");
                case 
19format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1116397");
                case 
20format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
                case 
21format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
                case 
22format(stationsizeof(station), "http://38.107.220.164:8014");
                case 
23format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=847066");
            }
            if(
Audio_IsClientConnected(playerid))
             {
                 
Audio_Stop(playeridstationidp[playerid]);
                
stationidp[playerid] = Audio_PlayStreamed(playeridstationfalsetruefalse);
            }
        }
        new 
vehicleid GetPlayerVehicleID(playerid);
        if( 
GetPVarIntplayerid"ToBeEjected" ) >= )
        {
               
SetPVarIntplayerid"ToBeEjected");
               
RemovePlayerFromVehicleplayerid );
               new 
Float:XFloat:YFloat:Z;
            
GetPlayerPos(playeridXYZ);
            
SetPlayerPos(playeridXYZ+2);
            if(
GetPVarInt(playerid"Injured") == 1)
              {
                  
Streamer_UpdateEx(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
                   
SetPlayerPos(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
                
SetPlayerVirtualWorld(playeridGetPVarInt(playerid,"MedicVW"));
                
SetPlayerInterior(playeridGetPVarInt(playerid,"MedicInt"));
                   
ClearAnimations(playerid);
                
LoopingAnim(playerid,"KNIFE","KILL_Knife_Ped_Die",4.0,0,1,1,1,0);
               }
           }
        
//SetPVarInt(playerid, "LastWeapon", GetPlayerWeapon(playerid));
        
gLastCar[playerid] = vehicleid;
    }
    if(
newstate == PLAYER_STATE_WASTED)
    {
        if(
GetPVarInt(playerid"EventToken") == 0)
        {
            
SetPVarInt(playerid"MedicBill"1);
        }
        if(
ConnectedToPC[playerid] == 1337)//mdc
        
{
            
ConnectedToPC[playerid] = 0;
        }
        
Seatbelt[playerid] = 0;
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
stationidv[GetPlayerVehicleID(playerid)] != 0)
        {
            new 
station[64];
            switch(
stationidv[GetPlayerVehicleID(playerid)])
            {
                case 
1format(stationsizeof(station), "http://216.246.109.162:8000");
                case 
2format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
                case 
3format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
                case 
4format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628721");
                case 
5format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283687");
                case 
6format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628932");
                case 
7format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1756658");
                case 
8format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
                case 
9format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057197");
                case 
10format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=18695");
                case 
11format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
                case 
12format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=181367");
                case 
13format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275071");
                case 
14format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
                case 
15format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
                case 
16format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1279013");
                case 
17format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1281016");
                case 
18format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280855");
                case 
19format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1116397");
                case 
20format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
                case 
21format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
                case 
22format(stationsizeof(station), "http://38.107.220.164:8014");
                case 
23format(stationsizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=847066");
            }
            if(
Audio_IsClientConnected(playerid))
             {
                 
Audio_Stop(playeridstationidp[playerid]);
                
stationidp[playerid] = Audio_PlayStreamed(playeridstationfalsetruefalse);
            }
        }
        new
            
newcar GetPlayerVehicleID(playerid),
            
enginelightsalarmdoorsbonnetbootobjectivev;
        
gLastCar[playerid] = newcar;
        
SetPVarInt(playerid"VehLamp"GetPlayerVehicleID(playerid));
         foreach(
Playeri) {
               
GetPlayerVehicle(inewcar);
            if(
!= -1) {
                if(
== playerid) {
                    new
                        
string[96];
                    
format(stringsizeof(string),"Anda pemilik %s ini."GetVehicleName(newcar));
                    
SendClientMessageEx(playeridCOLOR_GREYstring);
                    if(
PlayerVehicleInfo[i][v][pvTicket] != 0)
                    {
                        
format(stringsizeof(string),"(%s) surat tilang ada di kendaraan anda. Anda harus membayarnya di tempat Insurance."FormatMoney(PlayerVehicleInfo[i][v][pvTicket]));
                        
SendClientMessageEx(playeridCOLOR_GREYstring);
                    }
                    if(
PlayerVehicleInfo[i][v][pvImpounded] == 1)
                    {
                        
SendClientMessageEx(playeridCOLOR_GREY"[IMPOUND] Kendaraan anda telah disita oleh L.S.P.D");
                        
RemovePlayerFromVehicle(playerid);
                        return 
1;
                    }
                }
                else    if(
== PlayerInfo[playerid][pVehicleKeysFrom]) {
                    new
                        
string[64 MAX_PLAYER_NAME];
                    
format(stringsizeof(string),"Anda memiliki kunci %s ini dari pemiliknya %s."GetVehicleName(newcar), GetPlayerNameEx(i));
                    
SendClientMessageEx(playeridCOLOR_GREYstring);
                }
                else if(
PlayerVehicleInfo[i][v][pvLocked] == && PlayerVehicleInfo[i][v][pvLock] == 1) {
                    
GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(newcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
                    
SetTimerEx("DisableVehicleAlarm"200000"d",  newcar);
                }
                else if(
PlayerVehicleInfo[i][v][pvLocked] == && PlayerVehicleInfo[i][v][pvLock] == 2) {
                    new
                        
string[49 MAX_PLAYER_NAME];
                      if(
PlayerInfo[playerid][pAdmin] < 1)
                    {
                        
format(stringsizeof(string), "* %s has been stunned by the electric anti-theft.",GetPlayerNameEx(playerid));
                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        new 
Float:XFloat:YFloat:ZFloat:HP;
                         
GetPlayerPos(playeridXYZ);
                         
SendAudioToRange(103001000XYZ20.0);
                         
SetPlayerPos(playerid1YZ);
                         
RemovePlayerFromVehicle(playerid);
                         
SetPVarInt(playerid"IsFrozen"1);
                        
TogglePlayerControllable(playerid,0);
                        
SetTimerEx("ReleasePlayer"100000"d"playerid);
                        
GameTextForPlayer(playerid,"~r~STUNNED!",11000,3);
                        
GetPlayerHealth(playerid,HP);
                        
SetPlayerHealth(playerid,HP-15);
                    }
                    else
                    {
                        
format(stringsizeof(string), "Warning: This %s is owned by %s."GetVehicleName(newcar), GetPlayerNameEx(i));
                          
SendClientMessageEx(playeridCOLOR_GREYstring);
                    }
                }
                return 
1;
            }
        }
        for(new 
0MAX_FAMILYf++) {
            
GetGangVehicle(fnewcar);
            if(
!= -1) {
                new 
string[49 MAX_PLAYER_NAME];
                if(
PlayerInfo[playerid][pFMember] == f)
                {
                    
format(stringsizeof(string), "You are in the family that owns this %s."GetVehicleName(newcar));
                    
SendClientMessageEx(playeridCOLOR_GREYstring);
                }
                else if(
FamilyVehicleInfo[f][v][fvLocked] == && FamilyVehicleInfo[f][v][fvLock] == 1)
                {
                    
GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(newcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
                    
SetTimerEx("DisableVehicleAlarm"200000"d",  newcar);
                }
                else if(
FamilyVehicleInfo[f][v][fvLocked] == && FamilyVehicleInfo[f][v][fvLock] == 2)
                {
                    
format(stringsizeof(string), "* %s has been stunned by the electric anti-theft.",GetPlayerNameEx(playerid));
                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    new 
Float:XFloat:YFloat:ZFloat:HP;
                    
GetPlayerPos(playeridXYZ);
                    
SendAudioToRange(103001000XYZ20.0);
                    
SetPlayerPos(playerid1YZ);
                    
RemovePlayerFromVehicle(playerid);
                    new 
Float:slxFloat:slyFloat:slz;
                    
GetPlayerPos(playeridslxslyslz);
                    
SetPlayerPos(playeridslxslyslz);
                    
SetPVarInt(playerid"IsFrozen"1);
                    
TogglePlayerControllable(playerid,0);
                    
SetTimerEx("ReleasePlayer"100000"d"playerid);
                    
GameTextForPlayer(playerid,"~r~STUNNED!",11000,3);
                    
GetPlayerHealth(playerid,HP);
                    
SetPlayerHealth(playerid,HP-15);
                }
                return 
1;
            }
        }
        new 
vehicleid newcar;
        if(
IsACopCar(vehicleid))
        {
            if(
PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
            {
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                new 
Float:slxFloat:slyFloat:slz;
                
GetPlayerPos(playeridslxslyslz);
                
SetPlayerPos(playeridslxslyslz);
                
NOPCheck(playerid);
            }
        }
        else if(
IsAnAmbulance(vehicleid))
        {
            if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == && PlayerInfo[playerid][pDivision] == 2)
            {
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                new 
Float:slxFloat:slyFloat:slz;
                
GetPlayerPos(playeridslxslyslz);
                
SetPlayerPos(playeridslxslyslz);
                
NOPCheck(playerid);
            }
        }
         else if(
IsANewsCar(vehicleid))
        {
            if(
PlayerInfo[playerid][pMember] == ||PlayerInfo[playerid][pLeader] == 9)
            {
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                new 
Float:slxFloat:slyFloat:slz;
                
GetPlayerPos(playeridslxslyslz);
                
SetPlayerPos(playeridslxslyslz);
                
NOPCheck(playerid);
            }
        }
        else if(
IsAHelicopter(vehicleid))
        {
            
PlayerInfo[playerid][pAGuns][GetWeaponSlot(46)] = 46;
            
GivePlayerValidWeapon(playerid4660000);
        }
        if( 
GetPVarIntplayerid"ToBeEjected" ) >= )
        {
               
SetPVarIntplayerid"ToBeEjected");
               
RemovePlayerFromVehicleplayerid );
               new 
Float:XFloat:YFloat:Z;
            
GetPlayerPos(playeridXYZ);
            
SetPlayerPos(playeridXYZ+2);
            if(
GetPVarInt(playerid"Injured") == 1)
              {
                  
Streamer_UpdateEx(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
                   
SetPlayerPos(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
                
SetPlayerVirtualWorld(playeridGetPVarInt(playerid,"MedicVW"));
                
SetPlayerInterior(playeridGetPVarInt(playerid,"MedicInt"));
                   
ClearAnimations(playerid);
                
ApplyAnimation(playerid"KNIFE""KILL_Knife_Ped_Die"4.0011101);
               }
           }
        
//if(lights == VEHICLE_PARAMS_UNSET) SetVehicleParamsEx(newcar,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
        
//SetPVarInt(playerid, "LastWeapon", GetPlayerWeapon(playerid));
        
GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
        if((
engine == VEHICLE_PARAMS_UNSET || engine == VEHICLE_PARAMS_OFF) && GetVehicleModel(newcar) != 509 && GetVehicleModel(newcar) != 481 && GetVehicleModel(newcar) != 510) {
        }
        else
        {
            if(
GetVehicleModel(GetPlayerVehicleID(playerid)) != 481 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 509 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 510)
            {
                 
textdrawscount++;
            }
        }
    }
    if(
newstate == 2)
    {
        if(
IsADSV(GetPlayerVehicleID(playerid)))
        {
            new 
strbuy[126];
            
format(strbuysizeof(strbuy), "Anda bisa membeli kendaraan ini.\n Harga: %s"FormatMoney(GetVehicleCost(GetVehicleModel(GetPlayerVehicleID(playerid)))));
            
ShowPlayerDialog(playeridDIALOG_BUYCARDIALOG_STYLE_MSGBOX"Beli Kendaraan"strbuy"Beli""Batal");
        }
    }
    if((
newstate == || newstate == || newstate == || newstate == 9) && pTazer[playerid] == 1)
    {
        
GivePlayerValidWeapon(playeridpTazerReplace[playerid], 60000);
        
pTazer[playerid] = 0;
    }
    new    
newcar GetPlayerVehicleID(playerid);
    if(
GetCarDealershipVehicleId(newcar) != -&& GetCarDealershipVehicleId(newcar) == GetPVarInt(playerid"editingcdveh")) return 1;
        if(
GetCarDealershipVehicleId(newcar) != -1)
        {
            new 
string[57 20 4];
            
format(stringsizeof(string),"Would you like to buy this {00FF00}%s?\n\nThis vehicle costs {00FFFF}%s."GetVehicleName(newcar), FormatMoney(DealerInfo[GetCarDealershipId(newcar)][cdVehicleCost][GetCarDealershipVehicleId(newcar)]));
            
ShowPlayerDialog(playerid,DIALOG_CDBUY,DIALOG_STYLE_MSGBOX,"Warning:",string,"Buy","Cancel");
            
TogglePlayerControllable(playeridfalse);
            return 
1;
        }
    if(
newstate == PLAYER_STATE_SPAWNED)
    {
        if(
ConnectedToPC[playerid] == 1337)//mdc
        
{
            
ConnectedToPC[playerid] = 0;
        }
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
        
gPlayerSpawned[playerid] = 1;
        
SafeTime[playerid] = 60;
    }
    if(
newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 519)
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        if(
VehicleStatus{vehicleid} == 1) return SendClientMessageEx(playeridCOLOR_WHITE"You are not allowed to enter this Shamal as it's been damaged!");
        new 
string[47 MAX_PLAYER_NAME];
           
format(stringsizeof(string), "* %s enters the Shamal airplane as a passenger."GetPlayerNameEx(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
         
SetPlayerPos(playerid2.50903623.1187301199.593750);
         
SetPlayerFacingAngle(playerid82.14);
        
SetCameraBehindPlayer(playerid);
        
PlayerInfo[playerid][pVW] = vehicleid;
        
SetPlayerVirtualWorld(playeridvehicleid);
        
PlayerInfo[playerid][pInt] = 1;
        
SetPlayerInterior(playerid1);
        
InsideShamal[playerid] = vehicleid;
        
SendClientMessageEx(playeridCOLOR_WHITE"Type /exit near the door to exit the vehicle, or /window to look outside.");
    }
    
IsPlayerSteppingInVehicle[playerid] = -1;
    return 
1;
}
player_remove_vip_toys(iTargetID) {
    if(
PlayerInfo[iTargetID][pDonateRank] >= 3) return 1;
    else for(new 
iToyIteriToyIter MAX_PLAYER_ATTACHED_OBJECTS; ++iToyIter) {
        for(new 
LoopRapistLoopRapist sizeof(HoldingObjectsCop); ++LoopRapist) {
            if(
HoldingObjectsCop[LoopRapist][holdingmodelid] == PlayerToyInfo[iTargetID][iToyIter][ptModelID]) {
                
PlayerToyInfo[iTargetID][iToyIter][ptModelID] = 0;
                
PlayerToyInfo[iTargetID][iToyIter][ptBone] = 0;
                
PlayerToyInfo[iTargetID][iToyIter][ptPosX] = 0.0;
                
PlayerToyInfo[iTargetID][iToyIter][ptPosY] = 0.0;
                
PlayerToyInfo[iTargetID][iToyIter][ptPosZ] = 0.0;
                
PlayerToyInfo[iTargetID][iToyIter][ptPosX] = 0.0;
                
PlayerToyInfo[iTargetID][iToyIter][ptPosY] = 0.0;
                
PlayerToyInfo[iTargetID][iToyIter][ptPosZ] = 0.0;
                if(
IsPlayerAttachedObjectSlotUsed(iTargetIDiToyIter)) RemovePlayerAttachedObject(iTargetIDiToyIter);
            }
        }
    }
    
SendClientMessageEx(iTargetIDCOLOR_WHITE"All accessories/toys that were property of your former employer have been removed.");
    return 
1;

Anyone can help me to fix this ?, please... sorry for my bad English.
Reply
#2

Hi
try to remove this
PHP код:
// OnTaxiPlayerStateChange(playerid, newstate, oldstate); 
Reply
#3

Try using debug level 3, so it shows you the exact lines that produce the crash. You must do this:
Create a file called pawn.cfg in your pawno folder, inside this file write:
PHP код:
-d3 
After you made this thing please reply with the errors code here.
Don't forget to save the file and recompile your script.
Reply
#4

Quote:
Originally Posted by FaLLenGirL
Посмотреть сообщение
Try using debug level 3, so it shows you the exact lines that produce the crash. You must do this:
Create a file called pawn.cfg in your pawno folder, inside this file write:
PHP код:
-d3 
After you made this thing please reply with the errors code here.
Don't forget to save the file and recompile your script.
PHP код:
[00:53:40] [debugRun time error 4"Array index out of bounds"
[00:53:40] [debug]  Attempted to read/write array element at negative index -400
[00:53:40] [debugAMX backtrace:
[
00:53:40] [debug#0 001bcfec in public avt_OnPlayerStateChange (playerid=0, newstate=8, oldstate=0) at C:\Users\PC-20\Desktop\Roleplay\gamemodes\Roleplay.pwn:20641
[00:53:40] [debug#1 0001b148 in public OnPlayerStateChange (playerid=0, newstate=8, oldstate=0) at C:\Users\PC-20\Desktop\Roleplay\pawno\include\anti-vehicle_teleporter.inc:155
[00:53:40] [debugRun time error 4"Array index out of bounds"
[00:53:40] [debug]  Attempted to read/write array element at negative index -400
[00:53:40] [debugAMX backtrace:
[
00:53:40] [debug#0 001bcfec in public avt_OnPlayerStateChange (playerid=0, newstate=1, oldstate=8) at C:\Users\PC-20\Desktop\Roleplay\gamemodes\Roleplay.pwn:20641
[00:53:40] [debug#1 0001b148 in public OnPlayerStateChange (playerid=0, newstate=1, oldstate=8) at C:\Users\PC-20\Desktop\Roleplay\pawno\include\anti-vehicle_teleporter.inc:155 
Reply
#5

And this for the anti-vehicle_teleporter.inc
https://sampforum.blast.hk/showthread.php?pid=1832467#pid1832467
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)