Samp command help
#2

Use this:
pawn Код:
stock GetClosestVehicle(playerid)
{
    new
        Float:fPos[3],
        Float:distance = 30,
        Float:curdistance,
        currentVehicle;
   
    for(new v = 0; v < MAX_VEHICLES; v++)
    {
        GetVehiclePos(v, fPos[0], fPos[1], fPos[2]);        
        curdistance = GetPlayerDistanceFromPoint(playerid, fPos[0], fPos[1], fPos[2]);
       
        if(curdistance < distance)
        {
            currentVehicle = v;
            distance = curdistance;
        }
    }
    return currentVehicle;
}
Reply


Messages In This Thread
Samp command help - by San1 - 22.06.2013, 17:44
Re: Samp command help - by IstuntmanI - 22.06.2013, 17:59
Re: Samp command help - by CountyRP - 22.06.2013, 18:00
Re: Samp command help - by RedFusion - 22.06.2013, 18:12

Forum Jump:


Users browsing this thread: 1 Guest(s)