26.12.2013, 05:05
Help to solve a problem please. crashdetect swears
PHP код:
public UpdateSpeedometr(playerid)
{
if(GetPlayerState(playerid) != 2) return true;
new strr[20];
format(strr,sizeof(strr),"SPEED: %i KM/H",SpeedVehicle(playerid));
TextDrawSetString(VehicleSpeedometr[playerid],strr);
format(strr,sizeof(strr),"FUEL: %i",Vehicle[vehicle][Fuel]);
TextDrawSetString(IndicatorVehicle2[playerid],strr);
format(strr,sizeof(strr),"NAME: %s",VehicleNameS[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(IndicatorVehicle4[playerid],strr);
new gocar[10];
if(Vehicle[vehicle][Engine] == false) { gocar = "~r~OFF"; }
else if(Vehicle[vehicle][Engine] >= false) { gocar = "~g~ON"; }
format(strr, sizeof(strr),"ENGINE: %s",gocar);
TextDrawSetString(IndicatorVehicle3[playerid],strr);
new carlocked[10];
if(Vehicle[vehicle][CarLock] == false) { carlocked = "~g~UNLOCK"; }
else if(Vehicle[vehicle][CarLock] >= false) { carlocked = "~r~LOCK"; }
format(strr, sizeof(strr),"STATUS: %s",carlocked);
TextDrawSetString(IndicatorVehicle[playerid],strr);
return 0;
}
PHP код:
[15:31:00] [debug] Run time error 4: "Array index out of bounds"
[15:31:00] [debug] Accessing element at negative index -400
[15:31:00] [debug] AMX backtrace:
[15:31:00] [debug] #0 00120b54 in public UpdateSpeedometr (0x00000022) from new.amx
PHP код:
format(strr,sizeof(strr),"NAME: %s",VehicleNameS[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
PHP код:
-400