09.11.2016, 06:10
Help me in this how to fix this one
#0 005081d4 in LockGangVehicle (family=1, carid=65535, type=2) at C:\Users\Popong\Desktop\Linux\gamemodes\MC-RP.pwn:85455
#3 00307ff4 in public LRAPID_OnGameModeInit () at C:\Users\Popong\Desktop\Linux\gamemodes\MC-RP.pwn:57481
Help me to fix this
Код:
ug] Run time error 4: "Array index out of bounds" [14:57:40] [debug] Attempted to read/write array element at index 65535 in array of size 2000 [14:57:40] [debug] AMX backtrace: [14:57:40] [debug] #0 005081d4 in LockGangVehicle (family=1, carid=65535, type=2) at C:\Users\Popong\Desktop\Linux\gamemodes\MC-RP.pwn:85455 [14:57:40] [debug] #1 00406588 in public OnVehicleSpawn (vehicleid=228) at C:\Users\Popong\Desktop\Linux\gamemodes\MC-RP.pwn:66001 [14:57:40] [debug] #2 native SetVehicleToRespawn () from samp-server.exe [14:57:40] [debug] #3 00307ff4 in public LRAPID_OnGameModeInit () at C:\Users\Popong\Desktop\Linux\gamemodes\MC-RP.pwn:57481 [14:57:40] [debug] #4 0001a86c in public Audio_OnGameModeInit () at C:\Users\Popong\Desktop\Linux\pawno\include\rapidfire.inc:91 [14:57:40] [debug] #5 native CallLocalFunction () from samp-server.exe [14:57:40] [debug] #6 00011a70 in public SSCANF_OnGameModeInit () at C:\Users\Popong\Desktop\Linux\pawno\include\audio.inc:119 [14:57:40] [debug] #7 0000af30 in public Timers_OnScriptInit () at C:\Users\Popong\Desktop\Linux\pawno\include\sscanf2.inc:205 [14:57:40] [debug] #8 native CallLocalFunction () from samp-server.exe [14:57:40] [debug] #9 00005aa8 in public zcmd_OnGameModeInit () at C:\Users\Popong\Desktop\Linux\pawno\include\YSI/y_timers.inc:224 [14:57:40] [debug] #10 native CallLocalFunction () from samp-server.exe [14:57:40] [debug] #11 000045d0 in public Itter_OnGameModeInit () at C:\Users\Popong\Desktop\Linux\pawno\include\ZCMD.inc:68 [14:57:40] [debug] #12 native CallLocalFunction () from samp-server.exe [14:57:40] [debug] #13 00001c4c in public OnGameModeInit () at C:\Users\Popong\Desktop\Linux\pawno\include\foreach.inc:667
PHP код:
LockGangVehicle(family, carid, type)
{
new v = GetGangVehicle(family, carid);
if(FamilyVehicleInfo[family][v][fvId] == carid && type == 2)
{
LockStatus[carid] = 1;
vehicle_lock_doors(carid);
}
}
UnLockGangVehicle(family, carid, type)
{
new v = GetGangVehicle(family, carid);
if(FamilyVehicleInfo[family][v][fvId] == carid && type == 2)
{
LockStatus[carid] = 0;
vehicle_unlock_doors(carid);
}
}
PHP код:
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 != -1)
{
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;
}
}
}
}
return 1;
}
PHP код:
for(new x;x<sizeof(SANVehicles);x++) {
format(string, sizeof(string), "SAN %d", SANVehicles[x]);
SetVehicleNumberPlate(SANVehicles[x], string);
SetVehicleToRespawn(SANVehicles[x]);
}