GetClosestVehicleFromVehicle ??
#1

Can Somebody show me to create that function ??
Reply
#2

pawn Код:
GetClosestVehicleFromVehicle(vehicleid)
{
    new
        Float:X,
        Float:Y,
        Float:Z,
        Float:Distance,
        Float:DefaultDistance = 999999999.9,
        vID = INVALID_VEHICLE_ID;

    GetVehiclePos(vehicleid,X,Y,Z);

    for(new carid = 1; carid != MAX_VEHICLES; carid++)
        if(IsValidVehicle(carid))
        {
            Distance = GetVehicleDistanceFromPoint(carid, X, Y, Z);
            if(Distance < DefaultDistance)
            {
                DefaultDistance = Distance;
                vID = carid;
            }
        }

    return vID;
}
+

https://sampwiki.blast.hk/wiki/IsValidVehicle
Reply
#3

Thank You So Much
Reply
#4

sorry this returns the vehicleid id the player is in
Reply
#5

sorry messed up again it works thanx man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)