script help
#6

PHP код:
stock GetClosestVehicle(playeridFloat:range)
{
    new
        
Float:pos[3],
        
Float:distance,
        
Float:precedent_distance range +1,
        
precedent;
        
    
GetPlayerPos(playeridpos[0], pos[1], pos[2]);    
        
    for(new 
vehicleid 1vehicleid MAX_VEHICLESvehicleid++)
    {    
        
distance GetVehicleDistanceFromPoint(vehicleidpos[0], pos[1], pos[2]);
        if(
distance <= range && distance <= precedent_distance)
        {
            
precedent vehicleid;
            
precedent_distance distance;
        }
    }
    return 
precedent;

And for use in command :
PHP код:
CMD:unlock(playeridparams[])
{
      new 
vehicle GetClosestVehicle(playerid3);
      if(
vehicle == INVALID_VEHICLE_ID) return SCM(playerid, -1"No vehicle at proximate");
      
// Lock/Unlock your veh and the ID of car is in variable "vehicle"
      
return 1;

Sorry for this bad script, I'm on phone
Reply


Messages In This Thread
script help - by TheDarkBlade - 17.08.2015, 15:59
Re: script help - by DanielMc - 17.08.2015, 16:16
Re: script help - by [KHK]Khalid - 17.08.2015, 16:31
Re: script help - by arad55 - 17.08.2015, 16:44
Re: script help - by [KHK]Khalid - 17.08.2015, 17:01
Re : script help - by MrAlexisX2 - 17.08.2015, 17:12

Forum Jump:


Users browsing this thread: 1 Guest(s)