04.03.2019, 18:15
Coloquei meu sistema de radar em uma verificaзгo do velocнmetro, e toda vez que passo ao lado da uma travada no servidor. Alguйm sabe porquк isto esta causando ?
PHP код:
task Velocimetro[500]()
{
foreach(new i: Player)
{
if(!gPlayerLogged[i])continue;
if(IsPlayerInAnyVehicle(i))
{
new Float:_hp;
new playervehicle;
new _v = GetPlayerVehicleID(i);
if ( (playervehicle = GetPlayerVehicleID(i)) != INVALID_VEHICLE_ID)
{
new string_velo[15];
format(string_velo, sizeof (string_velo), "%02d km/h", GetVehicleSpeed(playervehicle));
PlayerTextDrawSetString(i, textPlayerVelocimetro[1][i], string_velo);
GetVehicleHealth(_v, _hp);
format(string_velo, sizeof (string_velo), "%.0f%%", _hp/10);
PlayerTextDrawSetString(i, textPlayerVelocimetro[3][i], string_velo);
format(string_velo, sizeof (string_velo), "%02d Litros", Gas[playervehicle]);
PlayerTextDrawSetString(i, textPlayerVelocimetro[2][i], string_velo);
}
if(GetPlayerState(i) == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(i)) ^ 510 && GetVehicleModel(GetPlayerVehicleID(i)) ^ 481 && GetVehicleModel(GetPlayerVehicleID(i)) ^ 509)
{
for(new u; u < 120; ++ u)
{
if(IsPlayerInRangeOfPoint(i, 40.0, RADAR[u][rPosX], RADAR[u][rPosY], RADAR[u][rPosZ]))
{
if(GetPlayerVehicleSpeed(i) > RADAR[u][rSpeed])
{
SendClientMessageEx(i, -1, "MULTADO!");
}
}
}
}
}
}
return true;
}