GetClosestCar
#2

Try
Код:
stock GetClosestVehicle(playerid)
{
    new vehicleid = INVALID_VEHICLE_ID;
    new Float:distance = 99999.0;
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    for(i = 0; i < MAX_VEHICLES; i++)
    {
        if(GetVehicleDistanceFromPoint(i, X, Y, Z) < distance && distance < 8.0) //you can change this value
        {
            vehicleid = i;
            distance = GetVehicleDistanceFromPoint(i, X, Y, Z);
        }
    }
    return vehicleid;
}
Reply


Messages In This Thread
GetClosestCar - by Stefand - 09.05.2013, 18:33
Re: GetClosestCar - by TheStreetsRP - 09.05.2013, 18:48
Re: GetClosestCar - by Stefand - 09.05.2013, 20:11
Re: GetClosestCar - by zxc1 - 09.05.2013, 20:16
Re: GetClosestCar - by Stefand - 09.05.2013, 20:29
Re: GetClosestCar - by Scenario - 09.05.2013, 20:38
Re: GetClosestCar - by cessil - 09.05.2013, 21:34
Re: GetClosestCar - by Stefand - 09.05.2013, 21:40

Forum Jump:


Users browsing this thread: 3 Guest(s)