[Ajuda] Velocimetro
#1

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(
Playeri)
{
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(ianameMAX_PLAYER_NAME);
if(
IsPlayerInAnyVehicle(i)) {
new 
Float:XFloat:YFloat:ZFloat:Speed;
GetVehicleVelocity(GetPlayerVehicleID(i), XYZ);
Speed floatmul(floatsqroot(floatadd(floatadd(floatpower(X2), floatpower(Y2)),  floatpower(Z2))), 170.0);
new 
Float:vcarro;
GetVehicleHealth(GetPlayerVehicleID(i), vcarro);
new 
velocid;
velocid floatround(Speedfloatround_floor);
new 
string[128];
new 
PlayerVehicleModelID GetVehicleModel(GetPlayerVehicleID(i));
PlayerVehicleModelID -= 400;
new 
ncarro[30];
if(
velocid == 160){
SetTimerEx("remova"1000false"i"i);
}
if(
velocid == 170){
SetTimerEx("remova"1000false"i"i);
}
if(
velocid == 180){
SetTimerEx("remova"1000false"i"i);
}
if(
velocid 195){
SetTimerEx("banspeed"100false"i"i);
}
format(ncarro,30,PlayerVehicle[PlayerVehicleModelID]);
GetPlayer2DZone(izoneMAX_ZONE_NAME);
format(string128,"%i",velocid);
Radar(i);
}
}
return 
1;

Reply
#2

Qual a linha do erro ?
Reply
#3

Quote:

PlayerVehicleModelID -= 400;

Acredito que seja essa
Reply
#4

Tenta colocar assim:

PHP код:
PlayerVehicleModelID 400
Reply
#5

Quote:
Originally Posted by Adiiti
Посмотреть сообщение
Tenta colocar assim:

PHP код:
PlayerVehicleModelID 400
Agora fica assim
Код HTML:
debug] Run time error 4: "Array index out of bounds"
[debug]  Attempted to read/write array element at index 400 in array of size 212
[debug] AMX backtrace:
[debug] #0 00161310 in public Velocimetro () from RN.amx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)