E-mail Posted September 11, 2011 Posted September 11, 2011 Hi iam Making a resource see if last Player in round then Player sound you are the last men in round Congratulations see my code and Fix Please function DestructionMoney2() local alivePlayers = getAlivePlayers() if #alivePlayers == 1 then local playername = getPlayerName(alivePlayers[1]) local serial = getPlayerSerial(alivePlayers[1]) local sound = playSound("sounds/lastmen.mp3") setSoundVolume(sound, 0.5) end
Cadu12 Posted September 11, 2011 Posted September 11, 2011 playSound and setSoundVolume are Client-side, and not the server-side
CapY Posted September 11, 2011 Posted September 11, 2011 (edited) I don't have an idea will that work ( not tested ) . local playername = getPlayerName(alivePlayers[1]) local sound = playSound("sounds/lastmen.mp3") local alivePlayers = getAlivePlayers() function DestructionMoney2() if #alivePlayers == 1 then sound = playSound("sounds/lastmen.mp3") end end Edited September 11, 2011 by Guest
mjau Posted September 11, 2011 Posted September 11, 2011 again using qserverside and client side functions in same code
Twisted Posted September 11, 2011 Posted September 11, 2011 Capy Read cadu12 post he clearly stated playSoun dis clientside please re check
Castillo Posted September 12, 2011 Posted September 12, 2011 -- server side function DestructionMoney2() local alivePlayers = getAlivePlayers() if #alivePlayers == 1 then local playername = getPlayerName(alivePlayers[1]) local serial = getPlayerSerial(alivePlayers[1]) triggerClientEvent(alivePlayers[1],"playTheSound",alivePlayers[1]) end end -- client side addEvent("playTheSound",true) addEventHandler("playTheSound",root, function () local sound = playSound("sounds/lastmen.mp3") setSoundVolume(sound, 0.5) end)
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