15.03.2017, 23:56
[19:11:29] [debug] Run time error 4: "Array index out of bounds"
[19:11:29] [debug] Attempted to read/write array element at negative index -400
[19:11:29] [debug] AMX backtrace:
[19:11:29] [debug] #0 0016ada0 in public Speed () from Mundito.amx.
help me, tranks
[19:11:29] [debug] Attempted to read/write array element at negative index -400
[19:11:29] [debug] AMX backtrace:
[19:11:29] [debug] #0 0016ada0 in public Speed () from Mundito.amx.
PHP код:
public Speed()
{
for(new p = 0; p < GetMaxPlayers(); p++) if(IsPlayerConnected(p) && !IsPlayerNPC(p))
{
new vehicleid = GetPlayerVehicleID(p);
if(vehicleid)
{
new string[128], Float:X, Float:Y, Float:Z, Float:PointToPoint, Float:vhealth;
GetVehicleVelocity(vehicleid, X, Y, Z);
PointToPoint = (floatsqroot(floatpower(X, 2) + floatpower(Y, 2) + floatpower(Z, 2)))*100;
GetVehicleHealth(vehicleid,vhealth);
format(string,sizeof string ,"{00D1FF}Vehнculo: {FFFFFF}%s\n{00D1FF}Vida: {FFFFFF}%.2f\n{00D1FF}Velocidad: {FFFFFF}%ikm/h", VehicleName[GetVehicleModel(vehicleid)-400], vhealth, floatround(PointToPoint, floatround_floor));
DeletePlayer3DTextLabel(p, speedo3Dtext);
speedo3Dtext = CreatePlayer3DTextLabel(p, string, speedcolor, 0.0,-1.6,-0.35,20.0, INVALID_PLAYER_ID, vehicleid);
} else if(p) { DeletePlayer3DTextLabel(p, speedo3Dtext); }
}
}