Frend Williams
Умник
Всем доброго вечера. Вот такая ошибка флудит очень сильно.
PHP:
#0 005286f8 in public OnVehicleSpawn (vehicleid=187) at C:\Users\vlad0\OneDrive\Desktop\Club Online RP\Для основного Сервера\gamemodes\jd.pwn:33345
[17:03:41] [debug] #1 native SetVehicleToRespawn () in samp03svr
[17:03:41] [debug] #2 002c402c in public SpawnCars (playerid=1) at C:\Users\vlad0\OneDrive\Desktop\Club Online RP\Для основного Сервера\gamemodes\jd.pwn:26434
[17:03:41] [debug] Run time error 4: "Array index out of bounds"
[17:03:41] [debug] Attempted to read/write array element at negative index -1
Код:
publics: SpawnCars(playerid)
{
new spveh=0;
for(new c = 1; c <= GetVehiclePoolSize(); c++)
{
if(IsVehicleOccupied(c)) continue;
if(c >= ballascar[0] && c <= ballascar[1] || c >= rifacar[0] && c <= rifacar[1] || c >= coronoscar[0] && c <= coronoscar[1] || c >= grovecar[0] && c <= grovecar[1]
|| c >= vagoscar[0] && c <= vagoscar[1] || c == matsfuragrove[0] || c == matsfuraballas[0] || c == matsfuravagos[0] || c == matsfuraactek[0]
|| c == matsfurarifa[0] || c >= lcncar[0] && c <= lcncar[1] || c >= yakcar[0] && c <= yakcar[1] || c >= ruscar[0] && c <= ruscar[1]
|| c >= lsnewscar[0] && c <= lsnewscar[1] || c >= sapdcar[0] && c <= sapdcar[3] || c >= fbicar[0] && c <= fbicar[4]
|| c >= govcar[0] && c <= govcar[1] || c >= armcar[0] && c <= armcar[1] || c >= mehanik[0] && c <= mehanik[1]
|| c >= ministrcar[0] && c <= ministrcar[1] || c >= sapdpatrul[0] && c <= sapdpatrul[1] || c >= hitcar[0] && c < hitcar[1] || c >= medicsls[0] && c <= medicsls[1])
{
SetVehicleVirtualWorld(c, 0);
LinkVehicleToInterior(c, 0);
}
SetVehicleToRespawn(c);
spveh++;
}
string="";
format(string, 128, "Администратор %s зареспавнил незанятый транспорт. (%i шт)",getPlayerName(playerid), spveh);
SendClientMessageToAll(CORANGE, string);
return 1;
}
Код:
public OnVehicleSpawn(vehicleid)
{
loop::players(i)
{
if(vehicleid == HitmansCar[i])
{
DestroyVehicle(vehicleid);
VehicleCreator[vehicleid] = false;
HitmansCar[i] = INVALID_VEHICLE_ID;
}
for(GetPlayerPoolSize(); i != -1; i--)
if(vehicleid == PlayerCarID[ i ]) ChangeVehicleColor(vehicleid, VehInfo[vehicleid][vCol][0], VehInfo[vehicleid][vCol][1]);
if(GetPVarInt(i,"prod_vehicle_id") == vehicleid)
{
if(gPlayerProdText[i][0] != Text3D:-1 || gPlayerProdText[i][1] != Text3D:-1 || gPlayerProdCP[i] != -1)
{
if(gPlayerProdText[i][0] != Text3D:-1) DestroyDynamic3DTextLabel(gPlayerProdText[i][0]);
if(gPlayerProdText[i][1] != Text3D:-1) DestroyDynamic3DTextLabel(gPlayerProdText[i][1]);
if(gPlayerProdCP[i] != -1) DestroyDynamicCP(gPlayerProdCP[i]);
gPlayerProdText[i][0] = Text3D:-1;
gPlayerProdText[i][1] = Text3D:-1;
gPlayerProdCP[i] = -1;
SendClientMessage(i, CGRAY, "Ваш рабочий транспорт отбуксирован");
SendClientMessage(i, 0xFFFF00AA, "Рабочий день завершен");
DeletePVar(i,"prod_vehicle_id");
DeletePVar(i,"prod_next");
DeletePVar(i,"count_prod2");
DeletePVar(i,"ProdExit_Car");
}
}
if(PlayerInfo[i][pAvia] != -1 && vehicleid == caridhouse[i][3]) DestroyVehicle(vehicleid), caridhouse[i][3]=0;
if(GetPVarInt(i, #arenda_took) == vehicleid && GetPVarInt(i, #arenda_took) && GetPVarInt(i, #check_arenda_moped))
{
DestroyVehicle(vehicleid);
DeletePVar(i, #arenda_took);
DeletePVar(i, #check_arenda_moped);
SendClientMessage(i,COLOR_GREY,"Ваш арендованый мопед был удален!");
break;
}
}
if(gVehicleGun[vehicleid][vGunLoading] || gVehicleGun[vehicleid][vGunUnloading])
{
gVehicleGun[vehicleid][vGunGunAmount] = 0;
gVehicleGun[vehicleid][vGunLoading] = false;
gVehicleGun[vehicleid][vGunUnloading] = false;
if(gVehicleGun[vehicleid][vGunText] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(gVehicleGun[vehicleid][vGunText]);
gVehicleGun[vehicleid][vGunText] = Text3D:INVALID_3DTEXT_ID;
DestroyDynamicArea(gVehicleGun[vehicleid][vGunArea]);
DestroyDynamicPickup(gVehicleGun[vehicleid][vGunPickup]);
gVehicleGun[vehicleid][vGunArea] = 0;
gVehicleGun[vehicleid][vGunPickup] = 0;
Itter_Remove(VehicleGun,vehicleid);
}
if(Start{vehicleid})
{
DestroyDynamic3DTextLabel(mats3Dtxt[vehicleid]);
DestroyDynamicPickup(autopick_mats[vehicleid]);
Start{vehicleid} = false;
}
if(GetVehicleModel(vehicleid)==560 && vehicleid >= fbicar[2] && vehicleid <= fbicar[4])
{
DestroyDynamicObject(police[vehicleid]);
police[vehicleid] = CreateDynamicObject(19419,0,0,0,0,0,0,-1, -1, -1,100.0);
AttachDynamicObjectToVehicle(police[vehicleid], vehicleid, 0.0, 0.0, 0.85, 0.0, 0.0, 0.0);
AddVehicleComponent(vehicleid, 1010);
AddVehicleComponent(vehicleid, 1170);
AddVehicleComponent(vehicleid, 1029);
AddVehicleComponent(vehicleid, 1030);
AddVehicleComponent(vehicleid, 1031);
AddVehicleComponent(vehicleid, 1033);
AddVehicleComponent(vehicleid, 1139);
AddVehicleComponent(vehicleid, 1140);
}
if(GetVehicleModel(vehicleid) == 415 && vehicleid >= sapdcar[1] && vehicleid <= sapdcar[2])
{
DestroyDynamicObject(police[vehicleid]);
police[vehicleid] = CreateDynamicObject(19419,0,0,0,0,0,0,-1,-1,-1,100.0);
AttachDynamicObjectToVehicle(police[vehicleid], vehicleid, 0.02515, -0.46837, 0.58641, 0.00000, 0.00000, 0.00000);
}
return 1;
}
publics: FindPlayerInTable(playerid)
{
new rows, fields;
cache_get_data(rows, fields, db_handle);
SetPlayerPos(playerid, 404.37769, -1537.43677, 26.04700);
InterpolateCameraPos(playerid, 476.6465,-1519.2786,59.5451, 433.3408,-1572.6791,38.6693, 7500);
InterpolateCameraLookAt(playerid, 423.9204,-1559.8324,27.1943, 407.8569,-1540.2135,32.2734, 7500);
if(rows)
{
PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "id", db_handle);
cache_get_field_content(0, "pKey", PlayerInfo[playerid][pKey], db_handle, MAX_PASSWORD_SIZE);
LoginDialog(playerid);
SetPVarInt(playerid, #exitregister, 1);
printf("FindPlayerInTable | %s[%i] - %i",getPlayerName(playerid), playerid, PlayerInfo[playerid][pID]);
}
else
{
show_rules(playerid);
}
return 1;
}
