22.06.2015, 14:21
I made a code, but want to let him 100 percent functional, the problem is that when I approach a vehicle it checks another vehicle farther than what I desire, sometimes function checks as far even though vehicle one in front of you .. how can I fix it?
PHP Code:
public PlacaVeiculoPerto(playerid)
{
for( new i; i < MAX_VEHICLES; i++) {
new Float:Pos[3];
GetVehiclePos(i, Pos[0], Pos[1], Pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 7.0, Pos[0], Pos[1], Pos[2])) {
return i;
}
}
return 0;
}