Eduardo95 Posted February 17, 2013 Share 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 Link to comment
DNL291 Posted February 17, 2013 Share 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 ) Link to comment
Eduardo95 Posted February 17, 2013 Author Share Posted February 17, 2013 Still sound when player spawn Link to comment
DNL291 Posted February 17, 2013 Share Posted February 17, 2013 Worked for me. Try the code again. Link to comment
Eduardo95 Posted February 17, 2013 Author Share Posted February 17, 2013 Cool!! working now thanks so much!! Link to comment
Anderl Posted February 17, 2013 Share 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 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