Jump to content

start launch.mp3 in shooting [ rhino ]


//_Dragon

Recommended Posts

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

:arrowdown::arrowdown: 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 

Link to comment
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?

Link to comment
  • 2 months later...

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 ) 
  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...