//_Dragon Posted December 16, 2015 Posted December 16, 2015 When i shoot i listen the normal song's shooting rhino & after 8sec i list the reload.mp3 I want replace reload.mp3 ( mod sound ) with normal son shooting rhino there is the script function toggleRhino() if fired == false then if isPedInVehicle ( localPlayer ) and not isCursorShowing() then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) then if ( getElementModel ( veh ) == 432 ) then fired = true local turX, turY, turZ = getElementPosition(veh) local cx,cy,cz = getVehicleComponentPosition( veh, "misc_a" ) local x, y, z = getVehicleComponentPosition( veh, "misc_c" ) local barrelX, barrelY, barrelZ = getPositionFromElementOffset(veh,cx,cy,cz) local muzzleX, muzzleY, muzzleZ = getPositionFromElementOffset(veh,x,y,z) local velX = (muzzleX - barrelX) /range local velY = (muzzleY - barrelY) /range local velZ = (muzzleZ - barrelZ) /range local vx, vy, vz = getElementVelocity(veh) setElementVelocity (veh, vx+(((velX/3)*(-1))/50), vy+(((velY/3)*(-1))/50), vz+(((velZ/3)*(-1))/50) ) bullet = createProjectile(veh, 21, muzzleX, muzzleY, muzzleZ, 2, nil, 255,255,255, velX, velY, velZ) createExplosion(turX, turY, turZ-10, 8, false, 0.5, false) removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil start = getTickCount() drawHandler = addEventHandler("onClientRender", root, reload) time = 3250 soundTimer = setTimer(function() local sound = playSound("reload.mp3") setSoundVolume(sound, 10) setSoundMaxDistance(sound, 70 ) end, (reloadTime-500), 1) end end end end end
iPrestege Posted December 16, 2015 Posted December 16, 2015 function toggleRhino() if fired == false then if isPedInVehicle ( localPlayer ) and not isCursorShowing() then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) then if ( getElementModel ( veh ) == 432 ) then fired = true local turX, turY, turZ = getElementPosition(veh) local cx,cy,cz = getVehicleComponentPosition( veh, "misc_a" ) local x, y, z = getVehicleComponentPosition( veh, "misc_c" ) local barrelX, barrelY, barrelZ = getPositionFromElementOffset(veh,cx,cy,cz) local muzzleX, muzzleY, muzzleZ = getPositionFromElementOffset(veh,x,y,z) local velX = (muzzleX - barrelX) /range local velY = (muzzleY - barrelY) /range local velZ = (muzzleZ - barrelZ) /range local vx, vy, vz = getElementVelocity(veh) setElementVelocity (veh, vx+(((velX/3)*(-1))/50), vy+(((velY/3)*(-1))/50), vz+(((velZ/3)*(-1))/50) ) bullet = createProjectile(veh, 21, muzzleX, muzzleY, muzzleZ, 2, nil, 255,255,255, velX, velY, velZ) createExplosion(turX, turY, turZ-10, 8, false, 0.5, false) removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil start = getTickCount() drawHandler = addEventHandler("onClientRender", root, reload) time = 3250 end end end end end What i did is remove the sound only so that's what you are asking?
//_Dragon Posted December 16, 2015 Author Posted December 16, 2015 What i did is remove the sound only so that's what you are asking? Noo dude when i shoote i listen the normal sound rhino & after 7sec i listen the sound (reload.mp3) this sound (reload.mp3) i add it in script for replacing the normal sound's rhino shoote
1LoL1 Posted December 16, 2015 Posted December 16, 2015 . Anyone help to fixe it ?? Stop spaming with anyone help.. wtf in 2:12 you said where is problem and in 2:18 you said anyone help? you are really retard.
Addlibs Posted December 16, 2015 Posted December 16, 2015 I doubt anyone understands what you're trying to do - neither do I.
//_Dragon Posted December 16, 2015 Author Posted December 16, 2015 I doubt anyone understands what you're trying to do - neither do I. I want replace my sound reload.mp3 (l26 local sound = playSound("reload.mp3") to sound shooting Like this video Listen the sound
Xwad Posted March 17, 2016 Posted March 17, 2016 Nobody understands you becaouse your english is very bad.. But i think i know what your problem is becaouse i made the same think in this script. just replace this part of the script with my edited part: function projectileSound ( creator, veh ) local zeType = getProjectileType( source ) if zeType == 21 then if getElementType(creator) == "vehicle" then if getElementModel(creator) == 432 or getElementModel(creator) == 601 then local veh = getPedOccupiedVehicle(localPlayer) local velX, velY, velZ = getElementVelocity(source) local cx, cy, cz = getVehicleComponentPosition( creator, "misc_c" ) cx, cy, cz = getPositionFromElementOffset(creator, cx, cy, cz) fxAddTankFire(cx, cy, cz, velX, velY, velZ) setElementModel(source, 342) shoot = playSound("reload.mp3", false) setSoundVolume(shoot, 1) end end end end addEventHandler( "onClientProjectileCreation", getRootElement(), projectileSound )
Captain Cody Posted March 17, 2016 Posted March 17, 2016 From what I'm getting out of this: He wants to use the regular rhino shooting sound, then 7 seconds after he wants to play the (Reload.mp3) Fire(Rhino Sound) -> 7s Reload(Reload.mp3)
Xwad Posted March 17, 2016 Posted March 17, 2016 No i am sure he wants to add a new shooting sound and he is trying to do it on a very bad way. So this is how he wants to do it: changing the reload sound to a shootong sound and set the timer to 0.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now