Problems with a function
#10

Try this out:

PHP код:
#define LoopVehicles(%1) \
    
for(new %GetVehiclePoolSize(); != %1; %1--)
stock GetClosestVehicle(playeridFloat:range)
{
    new 
Floatp_XFloatp_YFloatp_ZFloatDistance 9999.9Vehicle INVALID_VEHICLE_IDFloatTemp;
    
GetPlayerPos(playeridp_Xp_Yp_Z);
    
LoopVehicles(i)
    {
        
Temp GetVehicleDistanceFromPoint(ip_Xp_Yp_Z);
        if(
range <= Temp <= Distance//if(Temp <= Distance && Temp <= range)
        
{
            
Vehicle i;
            
Distance Temp;
        }
    }
    return 
Vehicle;

Reply


Messages In This Thread
Problems with a function - by Antenastyle - 19.04.2017, 13:27
Re: Problems with a function - by Marricio - 19.04.2017, 13:33
Re: Problems with a function - by Antenastyle - 19.04.2017, 13:41
Re: Problems with a function - by Marricio - 19.04.2017, 13:47
Re: Problems with a function - by Antenastyle - 19.04.2017, 13:51
Re: Problems with a function - by JustNothing - 19.04.2017, 14:06
Re: Problems with a function - by Antenastyle - 19.04.2017, 14:30
Re: Problems with a function - by JustNothing - 19.04.2017, 15:45
Re: Problems with a function - by Antenastyle - 19.04.2017, 18:05
Re: Problems with a function - by Logic_ - 19.04.2017, 18:17

Forum Jump:


Users browsing this thread: 1 Guest(s)