Jump to content

Sound Help Please


roddydennvor

Recommended Posts

here you go :

addCommandHandler ( "lock", 
function(player) 
if not isPedInVehicle ( player ) then return end 
local veh = getPedOccupiedVehicle ( player ) 
setVehicleLocked ( veh , not isVehicleLocked ( veh ) ) 
local sound = playSound("sounds/............mp3") --Play  from the sounds folder 
setSoundVolume(sound, 0.5) -- set the sound volume to 50% 
end) 

Link to comment
here you go :
addCommandHandler ( "lock", 
function(player) 
if not isPedInVehicle ( player ) then return end 
local veh = getPedOccupiedVehicle ( player ) 
setVehicleLocked ( veh , not isVehicleLocked ( veh ) ) 
local sound = playSound("sounds/............mp3") --Play  from the sounds folder 
setSoundVolume(sound, 0.5) -- set the sound volume to 50% 
end) 

You mixed client with server.

Link to comment
-- Server Side 
addCommandHandler ( "lock", 
function(player) 
if not isPedInVehicle ( player ) then return end 
local veh = getPedOccupiedVehicle ( player ) 
setVehicleLocked ( veh , not isVehicleLocked ( veh ) ) 
triggerClientEvent(player,"playSound",player) 
end) 
  
-- Client side 
addEvent("playSound", true) 
addEventHandler("playSound",getRootElement(), 
function () 
    local volume = 1.0 -- 100% 
    local LoginSound = playSound ( "Sound/...........mp3" ) 
    setSoundVolume(LoginSound, volume) 
end) 

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...