Advertisement
Guest User

Untitled

a guest
Sep 5th, 2015
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. nextbeep = CurTime() -- Calculating/Repeating sounds
  2.  
  3. function SWEP:Think() -- TODO: Edit sounds, distances and others
  4.  
  5. for _, veh in pairs(ents.FindByClass("prop_vehicle_jeep")) do -- Find the vehicles
  6.  
  7. local dist = self.Owner:GetPos():Distance(veh:GetPos()) -- Get the position of you and the car, calculate the distance, we can use this distance for future refrence
  8.  
  9. if veh:IsVehicle() then if self.Owner:VehicleAccess( veh ) then
  10. if CurTime()>nextbeep then -- lol, works
  11.  
  12. self:EmitSound("HL1/fvox/beep.wav", (-0.0015*dist+82.2388))
  13. nextbeep = CurTime()+(0.003*dist*0.2388)
  14.  
  15.  
  16. end
  17. end
  18. end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement