micheal1230 Posted December 5, 2012 Share Posted December 5, 2012 How do I use setElementDimension And setElementPosition with playSound3D. Link to comment
Castillo Posted December 5, 2012 Share Posted December 5, 2012 theSound = playSound3D ( args... ) setElementDimension ( theSound, 1 ) setElementPosition ( theSound, 0, 0, 5 ) Link to comment
micheal1230 Posted December 5, 2012 Author Share Posted December 5, 2012 (edited) theSound = playSound3D ( args... ) setElementDimension ( theSound, 1 ) setElementPosition ( theSound, 0, 0, 5 ) Thanks Edited December 5, 2012 by Guest Link to comment
micheal1230 Posted December 5, 2012 Author Share Posted December 5, 2012 Why dont this work? VCM = playSound3D("vcm.mp3", 837.90606689453, -2066.2963867188, 16.712882995605,true) function OpenLogin() local width, height = guiGetScreenSize() local x,y,z = getElementPosition( getLocalPlayer ( ) ) local dim = getElementDimension( getLocalPlayer ( ) ) setElementDimension ( VCM, dim ) setElementPosition ( VCM, x,y,z ) setSoundVolume(VCM, 1) Link to comment
Castillo Posted December 5, 2012 Share Posted December 5, 2012 Why don't you just create the sound instead of setting the position? Link to comment
50p Posted December 5, 2012 Share Posted December 5, 2012 Why do you need to make it 3D anyway? It looks like a login script, so I guess, when you're logging in you don't move around. Why set its dimensions? It'll be played only for the person who logs in unless you trigger the event for everyone which would be pointless. Link to comment
micheal1230 Posted December 5, 2012 Author Share Posted December 5, 2012 Why do you need to make it 3D anyway? It looks like a login script, so I guess, when you're logging in you don't move around. Why set its dimensions? It'll be played only for the person who logs in unless you trigger the event for everyone which would be pointless. Yeah i want it to play for people that are on the log in screen Edit: My beats are playing now Link to comment
Tete omar Posted December 6, 2012 Share Posted December 6, 2012 it's so simple server addEventHandler("onPlayerJoin",root, function() triggerClientEvent(source,"newPlayer",source) end ) client addEvent("newPlayer",true) addEventHandler("newPlayer",localPlayer, function() playSound("vcm.mp3") end ) just try that Link to comment
micheal1230 Posted December 6, 2012 Author Share Posted December 6, 2012 it's so simpleserver addEventHandler("onPlayerJoin",root, function() triggerClientEvent(source,"newPlayer",source) end ) client addEvent("newPlayer",true) addEventHandler("newPlayer",localPlayer, function() playSound("vcm.mp3") end ) just try that Edit: My beats are playing now Link to comment
50p Posted December 6, 2012 Share Posted December 6, 2012 it's so simpleserver addEventHandler("onPlayerJoin",root, function() triggerClientEvent(source,"newPlayer",source) end ) client addEvent("newPlayer",true) addEventHandler("newPlayer",localPlayer, function() playSound("vcm.mp3") end ) just try that Edit: My beats are playing now It will play only if you have the resource downloaded and you join the server. Server will try to trigger client-side event even before the file is downloaded so the first time you join the server it will not play but the next time if the resource will not be changed then you will hear the sound. Link to comment
Tete omar Posted December 7, 2012 Share Posted December 7, 2012 Then he can use onClientResourceStart instead Link to comment
micheal1230 Posted December 8, 2012 Author Share Posted December 8, 2012 it's so simpleserver addEventHandler("onPlayerJoin",root, function() triggerClientEvent(source,"newPlayer",source) end ) client addEvent("newPlayer",true) addEventHandler("newPlayer",localPlayer, function() playSound("vcm.mp3") end ) just try that Edit: My beats are playing now It will play only if you have the resource downloaded and you join the server. Server will try to trigger client-side event even before the file is downloaded so the first time you join the server it will not play but the next time if the resource will not be changed then you will hear the sound. Nope tested it and it works Link to comment
50p Posted December 8, 2012 Share Posted December 8, 2012 @micheal1230, go to your client folder and find the client resources that you download from servers then delete the resource that plays the sound (so that you're like visiting your server for the first time) and see if it plays, if it does then you download the script quicker then server triggered the onPlayerJoin event which won't happen too often to other players if at all. Link to comment
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