GetClosestVehicle(...) is not working
#6

I made func like that too you can try:

PHP код:
GetClosestVehicle(playerid)
{
    new 
Float:vxFloat:vyFloat:vzlast_vehicle = -1Float:last_distance 99999;
    for(new 
vi 1vj GetVehiclePoolSize(); vi <= vjvi++)
    {
        
GetVehiclePos(vivxvyvz);
        if(
vi == INVALID_VEHICLE_ID || GetPlayerDistanceFromPoint(playeridvxvyvz) > last_distance) continue;
        
last_vehicle vi;
        
last_distance GetPlayerDistanceFromPoint(playeridvxvyvz);
    }
    return 
last_vehicle;

Reply


Messages In This Thread
[SOLVED]GetClosestVehicle(...) is not working - by Sibuscus - 29.06.2018, 18:20
Re: GetClosestVehicle(...) is not working - by Calisthenics - 29.06.2018, 18:25
Re: GetClosestVehicle(...) is not working - by Uvais - 29.06.2018, 18:29
Re: GetClosestVehicle(...) is not working - by Sibuscus - 29.06.2018, 18:33
Re: GetClosestVehicle(...) is not working - by Calisthenics - 29.06.2018, 18:36
Re: GetClosestVehicle(...) is not working - by Lokii - 29.06.2018, 18:56

Forum Jump:


Users browsing this thread: 1 Guest(s)