micheal1230 Posted December 5, 2012 Posted December 5, 2012 How do I use setElementDimension And setElementPosition with playSound3D.
Castillo Posted December 5, 2012 Posted December 5, 2012 theSound = playSound3D ( args... ) setElementDimension ( theSound, 1 ) setElementPosition ( theSound, 0, 0, 5 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
micheal1230 Posted December 5, 2012 Author Posted December 5, 2012 (edited) theSound = playSound3D ( args... ) setElementDimension ( theSound, 1 ) setElementPosition ( theSound, 0, 0, 5 ) Thanks Edited December 5, 2012 by Guest
Castillo Posted December 5, 2012 Posted December 5, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
micheal1230 Posted December 5, 2012 Author 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)
Castillo Posted December 5, 2012 Posted December 5, 2012 Why don't you just create the sound instead of setting the position? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
50p Posted December 5, 2012 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. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
micheal1230 Posted December 5, 2012 Author 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
Tete omar Posted December 6, 2012 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
micheal1230 Posted December 6, 2012 Author 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
50p Posted December 6, 2012 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. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Tete omar Posted December 7, 2012 Posted December 7, 2012 Then he can use onClientResourceStart instead
micheal1230 Posted December 8, 2012 Author 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
50p Posted December 8, 2012 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. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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