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 )
Eduardo95 Posted February 17, 2013 Author Posted February 17, 2013 Cool!! working now thanks so much!!
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
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