Eduardo95 Posted February 17, 2013 Posted February 17, 2013 Hello i'm new in the script world and i need a little help with this. function startMySound() sound = playSound( "1.mp3", true ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), startMySound ) function stopMySound() stopSound( sound ) end addEventHandler ( "onPlayerSpawn ", stopMySound ) I can't make the musica stop when player spawn, thanks
DNL291 Posted February 17, 2013 Posted February 17, 2013 The "onPlayerSpawn" event is serverside only. function startMySound() sound = playSound( "1.mp3", true ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), startMySound ) function stopMySound() stopSound( sound ) end addEventHandler ( "onClientPlayerSpawn", localPlayer, stopMySound ) Please do not PM me with scripting related question nor support, use the forums instead.
DNL291 Posted February 17, 2013 Posted February 17, 2013 Worked for me. Try the code again. Please do not PM me with scripting related question nor support, use the forums instead.
Eduardo95 Posted February 17, 2013 Author Posted February 17, 2013 Cool!! working now thanks so much!!
DNL291 Posted February 17, 2013 Posted February 17, 2013 You're welcome. Please do not PM me with scripting related question nor support, use the forums instead.
Anderl Posted February 17, 2013 Posted February 17, 2013 You also had a space in the event name. And use pre-defined variables instead: https://wiki.multitheftauto.com/wiki/Pre ... ables_list "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
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