Sign in to follow this  
roddydennvor

Sound Help Please

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) 

Share this post


Link to post
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.

Share this post


Link to post
-- 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) 

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.