05.03.2012, 13:31
Erorrs in server_log.txt -
[with the plugin debug]
Thanks Alot
PHP код:
[16:32:52] [debug] Run time error 4: "Array index out of bounds"
[16:32:52] [debug] Accessing element at negative index -400
[16:32:52] [debug] Backtrace (most recent call first):
[16:32:52] [debug] #0 public LuX_SpeedoMeterUp()+0x1d5e30 from TalDmMod.amx
PHP код:
Public -
forward LuX_SpeedoMeterUp();
public LuX_SpeedoMeterUp()
{
new Float:LPosX;
new Float:LPosY;
new Float:LPosZ;
new Float:PlayerSpeedDistance;
new value;
new Float:L_VehHealth;
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER && PlayerSpeedo[i] == 0)
{
GetPlayerPos(i, LPosX, LPosY, LPosZ);
GetPlayerVehicleID(i);
GetVehicleHealth(GetPlayerVehicleID(i), L_VehHealth);
PlayerSpeedDistance = floatsqroot(floatpower(floatabs(floatsub(LPosX,LuX_ReadPlayerPosition[i][ReadX])),2)+floatpower(floatabs(floatsub(LPosY,LuX_ReadPlayerPosition[i][ReadY])),2)+floatpower(floatabs(floatsub(LPosZ,LuX_ReadPlayerPosition[i][ReadZ])),2));
value = floatround(PlayerSpeedDistance * 5000);
new LuxZone[MAX_ZONE_NAME];
GetPlayer2DZone(i, LuxZone, MAX_ZONE_NAME);
LKPH[i] = floatround(value/1000);
format(lstring,sizeof(lstring),"~b~Vehicle: ~w~%s~n~~b~Health: ~w~%.2f~n~~b~Gps: ~w~%s~n~%sKM/H: ~w~~n~%sNitro:",LVehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],L_VehHealth,LuxZone,MPH_KPH_Color,MPH_KPH_Color);
TextDrawSetString(LFunc[i], lstring);
TextDrawShowForPlayer(i, LFunc[i]);
LuX_ReadPlayerPosition[i][ReadX] = LPosX, LuX_ReadPlayerPosition[i][ReadY] = LPosY, LuX_ReadPlayerPosition[i][ReadZ] = LPosZ;
}
}
return 1;
}
