Jump to content

Clay

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by Clay

  1. so this gamemode its not selling id like to buy this gamemode plizzz pm for me
  2. Hello, I bought this gamemode from the owner, but these gamemode are not managed by the admin-system. Promises promising to help bring everything together but has not helped
  3. Clay

    vice city map

    hi all aim to problem for vice city map its not load very is problem ?
  4. Clay

    error account

    hello please help ERROR: account-manager/s_accounts.lua:172: attempt to call global 'passwordVerify' (a nil value)
  5. Is it possible to purchase this Gamemode because I understood that this project is dead?
  6. Hello Would like to get into the legacy roleplay gamemode if there is a request to contact through pm
  7. @CodyJ(L) : I just ask if is possible to make the same distance as spoiler #2?
  8. hello guys have problem i do not understand or its distance problem Spoiler 2 its not my server Spoiler 1 its my server
  9. Do not a possibility of vice city map other place ? Example on the water or any normal place somewhere other than at the up example here?
  10. What would this shader? maybe there is someone you used a ready-made?
  11. The problem is that when the lights do not work on the road using a vice city map? The light of the lamp is not on the road
  12. hi all I come with the problem of how to improve the vice city map fps to 60? When I switch on my map shows only 25 fps
  13. It did but nothing happens
  14. Clay

    hi all

    @LopSided_: The light of the lamp is not on the road
  15. Clay

    hi all

    hi all aim need help The problem is that when the lights do not work on the road using a vice city map?
  16. Is there any chance to get this script shader ?
  17. local sound local lastGear = nil local lastRPM = nil local downgrading = false local downgradingRPM = {0,0} local downgradingTime = 2000 local downgradingProgress = 0 local start = 0 local worked = 0 local vehiclesSounds = { [597] = {engine = "sounds/song1.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [542] = {engine = "sounds/song1.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [555] = {engine = "sounds/song2.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [482] = {engine = "sounds/song2.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [402] = {engine = "sounds/song3.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [491] = {engine = "sounds/song4.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [410] = {engine = "sounds/song4.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [492] = {engine = "sounds/song5.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [445] = {engine = "sounds/song6.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [426] = {engine = "sounds/song7.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [418] = {engine = "sounds/song8.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [466] = {engine = "sounds/song9.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [405] = {engine = "sounds/song10.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [474] = {engine = "sounds/song11.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [587] = {engine = "sounds/song12.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [518] = {engine = "sounds/song13.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [547] = {engine = "sounds/song14.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [426] = {engine = "sounds/song14.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [483] = {engine = "sounds/song15.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [412] = {engine = "sounds/song16.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [411] = {engine = "sounds/song17.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, } function startSound(vehicle) if isElement(vehicle) and not isElement ( getElementData ( vehicle, "carsound:sound" ) ) then local model = getElementModel ( vehicle ) if vehiclesSounds[model] then local x,y,z = getElementPosition ( vehicle ) local sound = playSound3D ( vehiclesSounds[model].engine, x, y, z, true ) attachElements ( sound, vehicle ) local rpm = getVehicleRPM(vehicle) setElementData (vehicle, "carsound:lastGear", getVehicleCurrentGear(vehicle), false) setElementData (vehicle, "carsound:lastRPM", rpm, false) setElementData (vehicle, "carsound:sound", sound, false) if vehiclesSounds[model].volume then setSoundVolume ( sound, vehiclesSounds[model].volume ) end setSoundMaxDistance ( sound, vehiclesSounds[model].maxDistance ) setSoundSpeed ( sound, rpm/vehiclesSounds[model].coeff ) end end end addEventHandler( "onClientElementStreamIn", getRootElement( ), function ( ) if getElementType( source ) == "vehicle" then startSound(source) end end ) addEventHandler( "onClientElementStreamOut", getRootElement( ), function ( ) if getElementType( source ) == "vehicle" then local sound = getElementData ( source, "carsound:sound" ) if isElement ( sound ) then destroyElement ( sound ) end local downgradingTimers = getElementData ( source, "carsound:downgradingTimers" ) or {} if isTimer ( downgradingTimers[1] ) then killTimer ( downgradingTimers[1] ) end if isTimer ( downgradingTimers[2] ) then killTimer ( downgradingTimers[2] ) end end end ) addEventHandler("onClientElementDestroy", getRootElement(), function () if getElementType(source) == "vehicle" then local sound = getElementData ( source, "carsound:sound" ) if isElement ( sound ) then destroyElement ( sound ) end local downgradingTimers = getElementData ( source, "carsound:downgradingTimers" ) or {} if isTimer ( downgradingTimers[1] ) then killTimer ( downgradingTimers[1] ) end if isTimer ( downgradingTimers[2] ) then killTimer ( downgradingTimers[2] ) end end end) --[[function unBugSounds() setTimer( function() setWorldSoundEnabled ( 40, false ) setWorldSoundEnabled (12, false ) addEventHandler("onClientRender", getRootElement(), checkVehiclesRPM ) for i, vehicle in ipairs ( getElementsByType ( "vehicle", true ) ) do startSound(vehicle) end 1000, 0) end end addEventHandler("onClientRender", root, unBugSounds) addEventHandler("onClientResourceStart",root,unBugSounds)]] function disableSounds() setWorldSoundEnabled ( 40, false ) setWorldSoundEnabled ( 12, false ) addEventHandler("onClientRender", getRootElement(), checkVehiclesRPM ) for i, vehicle in ipairs ( getElementsByType ( "vehicle", true ) ) do startSound(vehicle) end end addEventHandler("onClientResourceStart",getResourceRootElement(),disableSounds) function test(text,vehicle) if getPedOccupiedVehicle ( localPlayer ) and getPedOccupiedVehicle ( localPlayer ) == vehicle then outputChatBox(text) end end function checkVehiclesRPM() local x,y,z = getElementPosition ( localPlayer ) for i, vehicle in ipairs ( getElementsByType ( "vehicle", true ) ) do local tx, ty, tz = getElementPosition ( vehicle ) if getDistanceBetweenPoints3D (x,y,z,tx,ty,tz) < 40 then local sound = getElementData ( vehicle, "carsound:sound" ) if isElement(sound) then local rpm = getVehicleRPM(vehicle) if not getVehicleEngineState(vehicle) or rpm == 0 then if not isSoundPaused ( sound ) then --setSoundPaused ( sound, true ) end return true end if isSoundPaused ( sound ) then setSoundPaused ( sound, false ) end local model = getElementModel ( vehicle ) local lastGear = getElementData ( vehicle, "carsound:lastGear" ) or 1 local lastRPM = getElementData ( vehicle, "carsound:lastRPM" ) or 0 local curGear = getVehicleCurrentGear(vehicle) if lastGear > curGear then playGearSound(vehicle) end local downgradingTimers = getElementData ( vehicle, "carsound:downgradingTimers" ) or {} if lastGear > curGear and not downgrading then if isTimer ( downgradingTimers[1] ) then killTimer ( downgradingTimers[1] ) end if isTimer ( downgradingTimers[2] ) then killTimer ( downgradingTimers[2] ) end downgrading = true downgradingProgress = 0 worked = 0 start = getTickCount() downgradingRPM = {lastRPM,500} downgradingTimers[1] = setTimer (function() downgradingProgress = downgradingProgress+(1/(vehiclesSounds[model].downTime/50)) worked = worked+1 end, 50, vehiclesSounds[model].downTime/50) downgradingTimers[2] = setTimer (function() downgrading = false end, vehiclesSounds[model].downTime, 1) setElementData ( vehicle, "carsound:downgradingTimers", downgradingTimers, false ) else if curGear > lastGear then playBlowoffSound(vehicle) end if downgrading then if ( lastRPM < rpm and ( lastGear <= curGear ) ) or lastGear < curGear then if isTimer ( downgradingTimers[1] ) then killTimer ( downgradingTimers[1] ) end if isTimer ( downgradingTimers[2] ) then killTimer ( downgradingTimers[2] ) end downgrading = false end local temprpm = interpolateBetween ( downgradingRPM[1], 0, 0, downgradingRPM[2], 0, 0, downgradingProgress, "Linear" ) setSoundSpeed ( sound, temprpm/vehiclesSounds[model].coeff ) else setSoundSpeed ( sound, rpm/vehiclesSounds[model].coeff ) end end setElementData ( vehicle, "carsound:lastGear", curGear, false ) setElementData ( vehicle, "carsound:lastRPM", rpm, false ) end end end end addEventHandler("onClientResourceStart", getResourceRootElement(),startSound) function playBlowoffSound(vehicle) if isElement ( vehicle ) then local x,y,z = getElementPosition ( vehicle ) local px,py,pz = getElementPosition ( localPlayer ) if getDistanceBetweenPoints3D ( x,y,z, px,py,pz ) < 5 then local model = getElementModel ( vehicle ) local blowoffSound = playSound3D ( vehiclesSounds[model].blowoff, x, y, z, false ) attachElements ( blowoffSound, vehicle ) end end end function playGearSound(vehicle) if isElement ( vehicle ) then local x,y,z = getElementPosition ( vehicle ) local px,py,pz = getElementPosition ( localPlayer ) if getDistanceBetweenPoints3D ( x,y,z, px,py,pz ) < 15 then local model = getElementModel ( vehicle ) local gearSound = playSound3D ( vehiclesSounds[model].gear, x, y, z, false ) setSoundVolume(gearSound, 2) attachElements ( gearSound, vehicle ) end end end function getVehicleRPM(vehicle) if isElement(vehicle) then local vehicleRPM = getElementData ( vehicle, "rpm" ) or 0 if (isVehicleOnGround(vehicle)) then if (getVehicleEngineState(vehicle) == true) then if(getVehicleCurrentGear(vehicle) > 0) then vehicleRPM = math.floor(((getVehicleSpeed(vehicle)/getVehicleCurrentGear(vehicle))*180) + 0.99) if (vehicleRPM < 650) then vehicleRPM = math.random(650, 750) elseif (vehicleRPM >= 9800) then vehicleRPM = 9800 end else vehicleRPM = math.floor(((getVehicleSpeed(vehicle)/1)*180) + 0.99) if (vehicleRPM < 650) then vehicleRPM = math.random(650, 750) elseif (vehicleRPM >= 9800) then vehicleRPM = 9800 end end else vehicleRPM = 0 end else if (getVehicleEngineState(vehicle) == true) then vehicleRPM = vehicleRPM - 0 if (vehicleRPM < 650) then vehicleRPM = math.random(650, 750) elseif (vehicleRPM >= 9800) then vehicleRPM = 9800 end else vehicleRPM = 0 end end setElementData ( vehicle, "rpm", vehicleRPM, false ) return tonumber(vehicleRPM) else return 0 end end function getVehicleSpeed(vehicle) if isElement(vehicle) then local vx, vy, vz = getElementVelocity(vehicle) if (vx) and (vy)and (vz) then return math.sqrt(vx^2 + vy^2 + vz^2) * 180 -- km/h else return 0 end else return 0 end end correct this script need to repair the MTA on volume SFX Volume plizzz help me
  18. This is Vice City on the map but the MTA does not work well for both street lighting car lighting
  19. all lighting from the world is not on Where could be the problem?
  20. hi all I need help correct this script need to repair the MTA on volume SFX Volume plizzz help me local sound local lastGear = nil local lastRPM = nil local downgrading = false local downgradingRPM = {0,0} local downgradingTime = 2000 local downgradingProgress = 0 local start = 0 local worked = 0 local vehiclesSounds = { [597] = {engine = "sounds/song1.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [542] = {engine = "sounds/song1.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [555] = {engine = "sounds/song2.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [482] = {engine = "sounds/song2.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [402] = {engine = "sounds/song3.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [491] = {engine = "sounds/song4.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [410] = {engine = "sounds/song4.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [492] = {engine = "sounds/song5.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [445] = {engine = "sounds/song6.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [426] = {engine = "sounds/song7.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [418] = {engine = "sounds/song8.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [466] = {engine = "sounds/song9.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [405] = {engine = "sounds/song10.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [474] = {engine = "sounds/song11.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [587] = {engine = "sounds/song12.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [518] = {engine = "sounds/song13.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [547] = {engine = "sounds/song14.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [426] = {engine = "sounds/song14.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [483] = {engine = "sounds/song15.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [412] = {engine = "sounds/song16.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, [411] = {engine = "sounds/song17.wav",blowoff = "sounds/blowoff.wav",gear = "sounds/gear.wav", downTime = 2000, coeff = 10000, volume = 0.8, maxDistance = 20}, } function startSound(vehicle) if isElement(vehicle) and not isElement ( getElementData ( vehicle, "carsound:sound" ) ) then local model = getElementModel ( vehicle ) if vehiclesSounds[model] then local x,y,z = getElementPosition ( vehicle ) local sound = playSound3D ( vehiclesSounds[model].engine, x, y, z, true ) attachElements ( sound, vehicle ) local rpm = getVehicleRPM(vehicle) setElementData (vehicle, "carsound:lastGear", getVehicleCurrentGear(vehicle), false) setElementData (vehicle, "carsound:lastRPM", rpm, false) setElementData (vehicle, "carsound:sound", sound, false) if vehiclesSounds[model].volume then setSoundVolume ( sound, vehiclesSounds[model].volume ) end setSoundMaxDistance ( sound, vehiclesSounds[model].maxDistance ) setSoundSpeed ( sound, rpm/vehiclesSounds[model].coeff ) end end end addEventHandler( "onClientElementStreamIn", getRootElement( ), function ( ) if getElementType( source ) == "vehicle" then startSound(source) end end ) addEventHandler( "onClientElementStreamOut", getRootElement( ), function ( ) if getElementType( source ) == "vehicle" then local sound = getElementData ( source, "carsound:sound" ) if isElement ( sound ) then destroyElement ( sound ) end local downgradingTimers = getElementData ( source, "carsound:downgradingTimers" ) or {} if isTimer ( downgradingTimers[1] ) then killTimer ( downgradingTimers[1] ) end if isTimer ( downgradingTimers[2] ) then killTimer ( downgradingTimers[2] ) end end end ) addEventHandler("onClientElementDestroy", getRootElement(), function () if getElementType(source) == "vehicle" then local sound = getElementData ( source, "carsound:sound" ) if isElement ( sound ) then destroyElement ( sound ) end local downgradingTimers = getElementData ( source, "carsound:downgradingTimers" ) or {} if isTimer ( downgradingTimers[1] ) then killTimer ( downgradingTimers[1] ) end if isTimer ( downgradingTimers[2] ) then killTimer ( downgradingTimers[2] ) end end end) --[[function unBugSounds() setTimer( function() setWorldSoundEnabled ( 40, false ) setWorldSoundEnabled (12, false ) addEventHandler("onClientRender", getRootElement(), checkVehiclesRPM ) for i, vehicle in ipairs ( getElementsByType ( "vehicle", true ) ) do startSound(vehicle) end 1000, 0) end end addEventHandler("onClientRender", root, unBugSounds) addEventHandler("onClientResourceStart",root,unBugSounds)]] function disableSounds() setWorldSoundEnabled ( 40, false ) setWorldSoundEnabled ( 12, false ) addEventHandler("onClientRender", getRootElement(), checkVehiclesRPM ) for i, vehicle in ipairs ( getElementsByType ( "vehicle", true ) ) do startSound(vehicle) end end addEventHandler("onClientResourceStart",getResourceRootElement(),disableSounds) function test(text,vehicle) if getPedOccupiedVehicle ( localPlayer ) and getPedOccupiedVehicle ( localPlayer ) == vehicle then outputChatBox(text) end end function checkVehiclesRPM() local x,y,z = getElementPosition ( localPlayer ) for i, vehicle in ipairs ( getElementsByType ( "vehicle", true ) ) do local tx, ty, tz = getElementPosition ( vehicle ) if getDistanceBetweenPoints3D (x,y,z,tx,ty,tz) < 40 then local sound = getElementData ( vehicle, "carsound:sound" ) if isElement(sound) then local rpm = getVehicleRPM(vehicle) if not getVehicleEngineState(vehicle) or rpm == 0 then if not isSoundPaused ( sound ) then --setSoundPaused ( sound, true ) end return true end if isSoundPaused ( sound ) then setSoundPaused ( sound, false ) end local model = getElementModel ( vehicle ) local lastGear = getElementData ( vehicle, "carsound:lastGear" ) or 1 local lastRPM = getElementData ( vehicle, "carsound:lastRPM" ) or 0 local curGear = getVehicleCurrentGear(vehicle) if lastGear > curGear then playGearSound(vehicle) end local downgradingTimers = getElementData ( vehicle, "carsound:downgradingTimers" ) or {} if lastGear > curGear and not downgrading then if isTimer ( downgradingTimers[1] ) then killTimer ( downgradingTimers[1] ) end if isTimer ( downgradingTimers[2] ) then killTimer ( downgradingTimers[2] ) end downgrading = true downgradingProgress = 0 worked = 0 start = getTickCount() downgradingRPM = {lastRPM,500} downgradingTimers[1] = setTimer (function() downgradingProgress = downgradingProgress+(1/(vehiclesSounds[model].downTime/50)) worked = worked+1 end, 50, vehiclesSounds[model].downTime/50) downgradingTimers[2] = setTimer (function() downgrading = false end, vehiclesSounds[model].downTime, 1) setElementData ( vehicle, "carsound:downgradingTimers", downgradingTimers, false ) else if curGear > lastGear then playBlowoffSound(vehicle) end if downgrading then if ( lastRPM < rpm and ( lastGear <= curGear ) ) or lastGear < curGear then if isTimer ( downgradingTimers[1] ) then killTimer ( downgradingTimers[1] ) end if isTimer ( downgradingTimers[2] ) then killTimer ( downgradingTimers[2] ) end downgrading = false end local temprpm = interpolateBetween ( downgradingRPM[1], 0, 0, downgradingRPM[2], 0, 0, downgradingProgress, "Linear" ) setSoundSpeed ( sound, temprpm/vehiclesSounds[model].coeff ) else setSoundSpeed ( sound, rpm/vehiclesSounds[model].coeff ) end end setElementData ( vehicle, "carsound:lastGear", curGear, false ) setElementData ( vehicle, "carsound:lastRPM", rpm, false ) end end end end addEventHandler("onClientResourceStart", getResourceRootElement(),startSound) function playBlowoffSound(vehicle) if isElement ( vehicle ) then local x,y,z = getElementPosition ( vehicle ) local px,py,pz = getElementPosition ( localPlayer ) if getDistanceBetweenPoints3D ( x,y,z, px,py,pz ) < 5 then local model = getElementModel ( vehicle ) local blowoffSound = playSound3D ( vehiclesSounds[model].blowoff, x, y, z, false ) attachElements ( blowoffSound, vehicle ) end end end function playGearSound(vehicle) if isElement ( vehicle ) then local x,y,z = getElementPosition ( vehicle ) local px,py,pz = getElementPosition ( localPlayer ) if getDistanceBetweenPoints3D ( x,y,z, px,py,pz ) < 15 then local model = getElementModel ( vehicle ) local gearSound = playSound3D ( vehiclesSounds[model].gear, x, y, z, false ) setSoundVolume(gearSound, 2) attachElements ( gearSound, vehicle ) end end end function getVehicleRPM(vehicle) if isElement(vehicle) then local vehicleRPM = getElementData ( vehicle, "rpm" ) or 0 if (isVehicleOnGround(vehicle)) then if (getVehicleEngineState(vehicle) == true) then if(getVehicleCurrentGear(vehicle) > 0) then vehicleRPM = math.floor(((getVehicleSpeed(vehicle)/getVehicleCurrentGear(vehicle))*180) + 0.99) if (vehicleRPM < 650) then vehicleRPM = math.random(650, 750) elseif (vehicleRPM >= 9800) then vehicleRPM = 9800 end else vehicleRPM = math.floor(((getVehicleSpeed(vehicle)/1)*180) + 0.99) if (vehicleRPM < 650) then vehicleRPM = math.random(650, 750) elseif (vehicleRPM >= 9800) then vehicleRPM = 9800 end end else vehicleRPM = 0 end else if (getVehicleEngineState(vehicle) == true) then vehicleRPM = vehicleRPM - 0 if (vehicleRPM < 650) then vehicleRPM = math.random(650, 750) elseif (vehicleRPM >= 9800) then vehicleRPM = 9800 end else vehicleRPM = 0 end end setElementData ( vehicle, "rpm", vehicleRPM, false ) return tonumber(vehicleRPM) else return 0 end end function getVehicleSpeed(vehicle) if isElement(vehicle) then local vx, vy, vz = getElementVelocity(vehicle) if (vx) and (vy)and (vz) then return math.sqrt(vx^2 + vy^2 + vz^2) * 180 -- km/h else return 0 end else return 0 end end
×
×
  • Create New...