Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------
- -- Author: Disinterpreter
- -- License: Prorpietary software
- -- Copyright: (c) 2014
- -- Script: TougeTeam Warning Speed
- ---------------
- bState = true
- aCars = {420,560}
- function getVehicleSpeed()
- if isPedInVehicle(localPlayer) then
- local vx, vy, vz = getElementVelocity(getPedOccupiedVehicle(localPlayer))
- return math.sqrt(vx^2 + vy^2 + vz^2) * 161
- end
- return 0
- end
- addEventHandler("onClientRender", root,
- function()
- local pVehicle = getPedOccupiedVehicle(localPlayer);
- if pVehicle and isElement( pVehicle ) then
- for _,v in pairs (aCars) do
- local iModel = getElementModel(pVehicle)
- if (v == iModel) and (getVehicleSpeed() >= 100)
- then
- if bState == true then
- sound = playSound("sound.mp3", true)
- bState = false
- end
- end
- if (v == iModel) and (getVehicleSpeed() <= 100)
- then
- if bState == false then
- stopSound(sound)
- bState = true
- end
- end
- end
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement