18.10.2010, 23:05
i have this version: (didnt maded this one)
stock GetClosestVehicle(playerid) //By Darkrealm (edited by Gabrie "Larcius" Cordes)
{
if(IsPlayerConnected(playerid) && IsVehicleConnected(0))
{
new closestvehicle=0;
new Float:closestdist=GetDistanceToVehicle(playerid,0) ;
for(new vehicleid=0; vehicleid<MAX_VEHICLES; vehicleid++)
{
new Float:dist = GetDistanceToVehicle(playerid,vehicleid);
if ((dist < closestdist))
{
closestdist = dist;
closestvehicle = vehicleid;
}
}
return closestvehicle;
}
return -1;
}
stock GetClosestVehicle(playerid) //By Darkrealm (edited by Gabrie "Larcius" Cordes)
{
if(IsPlayerConnected(playerid) && IsVehicleConnected(0))
{
new closestvehicle=0;
new Float:closestdist=GetDistanceToVehicle(playerid,0) ;
for(new vehicleid=0; vehicleid<MAX_VEHICLES; vehicleid++)
{
new Float:dist = GetDistanceToVehicle(playerid,vehicleid);
if ((dist < closestdist))
{
closestdist = dist;
closestvehicle = vehicleid;
}
}
return closestvehicle;
}
return -1;
}