Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nextbeep = CurTime() -- Calculating/Repeating sounds
- function SWEP:Think() -- TODO: Edit sounds, distances and others
- for _, veh in pairs(ents.FindByClass("prop_vehicle_jeep")) do -- Find the vehicles
- 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
- if veh:IsVehicle() then if self.Owner:VehicleAccess( veh ) then
- if CurTime()>nextbeep then -- lol, works
- self:EmitSound("HL1/fvox/beep.wav", (-0.0015*dist+82.2388))
- nextbeep = CurTime()+(0.003*dist*0.2388)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement