01.02.2016, 06:45
Hallo guys i have problem with script, I need help
How to fix this
Debug with my server_log.txt
The public SystemTimer()
and public VehicleTimer ()
How to fix this
Debug with my server_log.txt
Код:
[08:40:33] [debug] #0 000829ac in public SystemTimer () from vliveb.amx [08:40:33] [debug] Run time error 4: "Array index out of bounds" [08:40:33] [debug] Accessing element at index 1500 past array upper bound 1499 [08:40:33] [debug] AMX backtrace: [08:40:33] [debug] #0 00082d44 in public VehicleTimer () from vliveb.amx [08:40:34] [debug] Run time error 4: "Array index out of bounds" [08:40:34] [debug] Accessing element at index 1500 past array upper bound 1499
PHP код:
forward SystemTimer();
public SystemTimer()
{
RunningTime++;
// respawnowanie śmieciarek
for(new vid = 0 ; vid < MAX_VEHICLES ; vid++)
{
if(vehicle[vid][vownertype] == 1)
{
if(vehicle[vid][vowneruid] == GROUP_TYPE_RUBBISH_UID || vehicle[vid][vowneruid] == GROUP_TYPE_PIZZA_UID)
{
if(!IsVehicleOccupied(vid))
{
if(vehicle[vid][vRubbishUnspawn] >= 60)
{
vehicle[vid][vRubbishUnspawn] = 0 ;
RespawnVehicle(vid);
}
else
{
vehicle[vid][vRubbishUnspawn]++;
}
}
}
}
}
// czyszczenie opisow niezalogownych postaci
for(new i = 0 ; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnect(i))
{
UpdateDynamic3DTextLabelText(Text3D:PlayerDesc[i], COLOR_ME, " ");
}
}
}
PHP код:
forward VehicleTimer();
public VehicleTimer()
{
for(new i = 0 ; i < MAX_VEHICLES; i++)
{
new Float:VehHP;
GetVehicleHealth(i,VehHP);
if(VehHP < 350)
{
vehicle[i][vhp] = 350;
SetVehicleHealth(i,350);
}
//offroad
new felgi = GetVehicleComponentInSlot(i, CARMODTYPE_WHEELS);
if(felgi == 1025)
{
new panels,doors,lights,tires;
GetVehicleDamageStatus(i,panels,doors,lights,tires);
UpdateVehicleDamageStatus(i,panels,doors,lights,0);
}
}
}