Crash detect with OnVehicleSpawn & Dialogs
#1

Hi, anyone can explain me where is the problem and why its printed with crashdetect plugin?

pawn Код:
[debug] Run time error 4: "Array index out of bounds"
[debug]  Accessing element at index 500 past array upper bound 499
[debug] AMX backtrace:
[debug] #0 00099d74 in ?? (377) from LG-RP.amx
[debug] #1 0000d7c8 in public OnVehicleSpawn (377) from AER-RP.amx
pawn Код:
[debug] #2 native SetVehicleToRespawn () from samp-server.exe
[debug] #3 0025afe0 in ?? (0, 12, 1, 11, 38415976) from AER-RP.amx
[debug] #4 0001054c in public OnDialogResponse (0, 12, 1, 11, 38415976) from LG-RP.amx
here is OnVehicleSpawn
pawn Код:
public OnVehicleSpawn(vehicleid)
{
    if(vehicleid != 509 && vehicleid != 481 && vehicleid != 510)
    {
        SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0);
        foreach(Player, i)
        {
            if(vehicleid == PlayerInfo[i][pVeh])
            {
                if(PlayerInfo[i][vLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
                ChangeVehiclePaintjob(PlayerInfo[i][pVeh], PlayerInfo[i][vPJ]);
                SetVehicleVirtualWorld(PlayerInfo[i][pVeh], PlayerInfo[i][pVehVW]);
                SetVehicleNumberPlate(PlayerInfo[i][pVeh], PlayerInfo[i][vPlate1]);
                DeleteNeons(vehicleid);
                neon[i] = 1;
                for(new x=0; x<14; i++)
                {
                    AddVehicleComponent(PlayerInfo[i][pVeh], PlayerInfo[i][pVehMod][x]);
                }
            }
            if(vehicleid == PlayerInfo[i][pVVeh])
            {
                if(PlayerInfo[i][vVLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
                ChangeVehiclePaintjob(PlayerInfo[i][pVVeh], PlayerInfo[i][vVPJ]);
                SetVehicleVirtualWorld(PlayerInfo[i][pVVeh], PlayerInfo[i][pVehVW]);
                SetVehicleNumberPlate(PlayerInfo[i][pVVeh], PlayerInfo[i][vPlate2]);
                DeleteNeons(vehicleid);
                vneon[i] = 1;
                for(new x=0; x<14; i++)
                {
                    AddVehicleComponent(PlayerInfo[i][pVVeh], PlayerInfo[i][pVVehMod][x]);
                }
            }
            if(vehicleid == PlayerInfo[i][pVVVeh])
            {
                if(PlayerInfo[i][vVVLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
                ChangeVehiclePaintjob(PlayerInfo[i][pVVVeh], PlayerInfo[i][vVVPJ]);
                SetVehicleVirtualWorld(PlayerInfo[i][pVVVeh], PlayerInfo[i][pVehVW]);
                SetVehicleNumberPlate(PlayerInfo[i][pVVVeh], PlayerInfo[i][vPlate3]);
                DeleteNeons(vehicleid);
                vneon[i] = 1;
                for(new x=0; x<14; i++)
                {
                    AddVehicleComponent(PlayerInfo[i][pVVVeh], PlayerInfo[i][pVVVehMod][x]);
                }
            }
            if(vehicleid == PlayerInfo[i][p4VVeh])
            {
                if(PlayerInfo[i][v4VLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
                ChangeVehiclePaintjob(PlayerInfo[i][p4VVeh], PlayerInfo[i][v4VPJ]);
                SetVehicleVirtualWorld(PlayerInfo[i][p4VVeh], PlayerInfo[i][pVehVW]);
                SetVehicleNumberPlate(PlayerInfo[i][p4VVeh], PlayerInfo[i][vPlate4]);
                DeleteNeons(vehicleid);
                vneon[i] = 1;
                for(new x=0; x<14; i++)
                {
                    AddVehicleComponent(PlayerInfo[i][p4VVeh], PlayerInfo[i][p4VVehMod][x]);
                }
            }
            if(vehicleid == PlayerInfo[i][p5VVeh])
            {
                if(PlayerInfo[i][v5VLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
                ChangeVehiclePaintjob(PlayerInfo[i][p5VVeh], PlayerInfo[i][v5VPJ]);
                SetVehicleVirtualWorld(PlayerInfo[i][p5VVeh], PlayerInfo[i][pVehVW]);
                SetVehicleNumberPlate(PlayerInfo[i][p5VVeh], PlayerInfo[i][vPlate5]);
                DeleteNeons(vehicleid);
                vneon[i] = 1;
                for(new x=0; x<14; i++)
                {
                    AddVehicleComponent(PlayerInfo[i][p5VVeh], PlayerInfo[i][p5VVehMod][x]);
                }
            }
        }
    }
    if(IsTruckerVehicle(vehicleid))
    {
        TruckPackages[vehicleid] = -1;
    }
    if(IsBrinksVehicle(vehicleid))
    {
        ZTruckPackages[vehicleid] = -1;
    }
    if(Siren[vehicleid])
    {
        Siren[vehicleid] = 0;
        DestroyDynamicObject(SirenObject[vehicleid]);
    }
    DestroyObject(obj1[vehicleid]);
    DestroyObject(obj2[vehicleid]);
    Flasher[vehicleid] = 0;
    StopBlinkNeons(vehicleid);
    return 1;
}
The dialogs crash output, i dont know what dialogid to look for.

EDIT: I manged to fix the dialogs problem, what about the OnVehicleSpawn?
Reply
#2

*Bump* please help..
Reply
#3

At first glance I can't see any errors in the code itself. I'd try using nativechecker and see if that gives you any more information.
Reply
#4

compile your script with d3 flag to get error line
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)