25.04.2017, 23:44
(
Последний раз редактировалось merloch; 26.04.2017 в 15:18.
)
Alguem ajuda ai? @edit Resolvi jб!
Код HTML:
[23:23:54] [debug] Run time error 4: "Array index out of bounds" [23:23:54] [debug] Attempted to read/write array element at negative index -400 [23:23:54] [debug] AMX backtrace: [23:23:54] [debug] #0 00161318 in public Velocimetro () from RN.amx
PHP код:
public Velocimetro()
{
foreach(Player, i)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(i, aname, MAX_PLAYER_NAME);
if(IsPlayerInAnyVehicle(i)) {
new Float:X, Float:Y, Float:Z, Float:Speed;
GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)), floatpower(Z, 2))), 170.0);
new Float:vcarro;
GetVehicleHealth(GetPlayerVehicleID(i), vcarro);
new velocid;
velocid = floatround(Speed, floatround_floor);
new string[128];
new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(i));
PlayerVehicleModelID -= 400;
new ncarro[30];
if(velocid == 160){
SetTimerEx("remova", 1000, false, "i", i);
}
if(velocid == 170){
SetTimerEx("remova", 1000, false, "i", i);
}
if(velocid == 180){
SetTimerEx("remova", 1000, false, "i", i);
}
if(velocid > 195){
SetTimerEx("banspeed", 100, false, "i", i);
}
format(ncarro,30,PlayerVehicle[PlayerVehicleModelID]);
GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
format(string, 128,"%i",velocid);
Radar(i);
}
}
return 1;
}