Crash Detect
#1

pawn Код:
public OnVehicleSpawn(vehicleid) {
    VehicleStatus{vehicleid} = 0;
    TruckContents[vehicleid] = 0;
    VehicleRadioStation[vehicleid] = 0;

    for(new i = 0; i < sizeof(FamilyInfo); i++) {
        for(new d = 0 ; d < MAX_GANG_VEHICLES; d++) {
            if(FamilyVehicleInfo[i][d][fvLocked] != 0 && FamilyVehicleInfo[i][d][fvLock] > 0)
                LockGangVehicle(i, FamilyVehicleInfo[i][d][fvId], FamilyVehicleInfo[i][d][fvLock]);
        }
    }

    switch(GetVehicleModel(vehicleid)) {
        case 427, 428, 432, 601, 528: SetTimerEx("DelayedVehHealth", 1000, false, "d", vehicleid);
    }

    new v;
    foreach(Player, i)
    {
        v = GetPlayerVehicle(i, vehicleid);
        if(v != INVALID_VEHICLE_ID)
        {
            if(PlayerVehicleInfo[i][v][pvId] == vehicleid && GetVehicleModel(vehicleid) != PlayerVehicleInfo[i][v][pvModelId])
            {
                DestroyVehicle(vehicleid);
                VehicleRadioStation[vehicleid] = 0;
                PlayerVehicleInfo[i][v][pvId] = CreateVehicle(PlayerVehicleInfo[i][v][pvModelId], PlayerVehicleInfo[i][v][pvPosX], PlayerVehicleInfo[i][v][pvPosY], PlayerVehicleInfo[i][v][pvPosZ], PlayerVehicleInfo[i][v][pvPosAngle],PlayerVehicleInfo[i][v][pvColor1], PlayerVehicleInfo[i][v][pvColor2], -1);
                if(PlayerVehicleInfo[i][v][pvLocked] == 1) LockPlayerVehicle(i, PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvLock]);
                ChangeVehiclePaintjob(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvPaintJob]);
                ChangeVehicleColor(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvColor1], PlayerVehicleInfo[i][v][pvColor2]);
                for(new m = 0; m < MAX_MODS; m++)
                {
                    if(PlayerVehicleInfo[i][v][pvMods][m] >= 1000 && PlayerVehicleInfo[i][v][pvMods][m] <= 1193)
                    {
                        if(InvalidModCheck(GetVehicleModel(vehicleid), PlayerVehicleInfo[i][v][pvMods][m]))
                        {
                            AddVehicleComponent(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvMods][m]);
                        }
                        else
                        {
                            //printf("Removing invalid mod %d from %d of %s", PlayerVehicleInfo[i][v][pvMods][m], GetVehicleModel(vehicleid), GetPlayerNameEx(i));
                            PlayerVehicleInfo[i][v][pvMods][m] = 0;
                        }
                    }
                }
            }
            else
            {
                ChangeVehiclePaintjob(vehicleid, PlayerVehicleInfo[i][v][pvPaintJob]);
                ChangeVehicleColor(vehicleid, PlayerVehicleInfo[i][v][pvColor1], PlayerVehicleInfo[i][v][pvColor2]);
                for(new m = 0; m < MAX_MODS; m++)
                {
                    if(PlayerVehicleInfo[i][v][pvMods][m] >= 1000 && PlayerVehicleInfo[i][v][pvMods][m] <= 1193)
                    {
                        if(InvalidModCheck(GetVehicleModel(vehicleid), PlayerVehicleInfo[i][v][pvMods][m]))
                        {
                            AddVehicleComponent(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvMods][m]);
                        }
                        else
                        {
                            //printf("Removing invalid mod %d from %d of %s", PlayerVehicleInfo[i][v][pvMods][m], GetVehicleModel(vehicleid), GetPlayerNameEx(i));
                            PlayerVehicleInfo[i][v][pvMods][m] = 0;
                        }
                    }
                }
                if(PlayerVehicleInfo[i][v][pvLocked] == 1) LockPlayerVehicle(i, PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvLock]);
            }
            new string[128];
            format(string,sizeof(string),"Your %s has been sent to the location at which you last parked it.",GetVehicleName(vehicleid));
            SendClientMessage(i, COLOR_GRAD1, string);
        }
    }

    if(LockStatus[vehicleid])
    {
        foreach(Player, i)
        {
            if(PlayerInfo[i][pLockCar] == vehicleid)
            {
                PlayerInfo[i][pLockCar] = INVALID_VEHICLE_ID;
            }
        }
    }

    if(VehicleBomb{vehicleid} == 1)
    {
        foreach(Player, i)
        {
            if(PlayerInfo[i][pFaction] == 4 || PlayerInfo[i][pLeader] == 4)
            {
                if(PlacedVehicleBomb[i] == vehicleid)
                {
                    VehicleBomb{vehicleid} = 0;
                    PlacedVehicleBomb[i] = INVALID_VEHICLE_ID;
                    PickUpC4(i);
                    PlayerInfo[i][pC4Used] = 0;
                    PlayerInfo[i][pC4Get] = 1;
                }
            }
        }
    }
    arr_Engine{vehicleid} = 0;
    return 1;
}


Код:
[16:25:45] [debug] Run time error 4: "Array index out of bounds"
[16:25:45] [debug]  Accessing element at index 65535 past array upper bound 1999
[16:25:45] [debug] AMX backtrace:
[16:25:45] [debug] #0 003efe7c in ?? (0x00000001, 0x0000ffff, 0x00000002) from MC-RP.amx
[16:25:45] [debug] #1 00326fc0 in public OnVehicleSpawn (0x000000e4) from MC-RP.amx
[16:25:45] [debug] #2 native SetVehicleToRespawn () [0046ff60] from samp-server.exe
[16:25:45] [debug] #3 0025f46c in public LRAPID_OnGameModeInit () from MC-RP.amx
[16:25:45] [debug] #4 0001592c in public Audio_OnGameModeInit () from MC-RP.amx
[16:25:45] [debug] #5 native CallLocalFunction () [004743b0] from samp-server.exe
[16:25:45] [debug] #6 0000e894 in public SSCANF_OnGameModeInit () from MC-RP.amx
[16:25:45] [debug] #7 native CallLocalFunction () [004743b0] from samp-server.exe
[16:25:45] [debug] #8 000089b0 in public Timers_OnScriptInit () from MC-RP.amx
[16:25:45] [debug] #9 native CallLocalFunction () [004743b0] from samp-server.exe
[16:25:45] [debug] #10 000048b0 in public zcmd_OnGameModeInit () from MC-RP.amx
[16:25:45] [debug] #11 native CallLocalFunction () [004743b0] from samp-server.exe
[16:25:45] [debug] #12 000037a8 in public Itter_OnGameModeInit () from MC-RP.amx
[16:25:45] [debug] #13 native CallLocalFunction () [004743b0] from samp-server.exe
[16:25:45] [debug] #14 00001650 in public OnGameModeInit () from MC-RP.amx
Reply
#2

I think this is why i cant connect and this is why im crashing but my server is on
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)