SnoopCat Posted July 20, 2011 Posted July 20, 2011 hello i have a script that when u die it plays a sound like WASTED.... well the thing i want to add to this script is an image on the screen and idk how to do it , if anyone wants to help here is the code i have function wasted (thePlayer) local sound = playSound("wasted.mp3",false) setSoundVolume(sound, 0.9) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wasted ) VISIT TSW RACING SERVER http://tswracing.net/
Castillo Posted July 20, 2011 Posted July 20, 2011 Use guiCreateStaticImage or draw one with dxDrawImage. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
SnoopCat Posted July 20, 2011 Author Posted July 20, 2011 soo it must be like this? function wasted (thePlayer) local sound = playSound("wasted.mp3",false) setSoundVolume(sound, 0.9) end function wasted (theplayer) guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wasted ) VISIT TSW RACING SERVER http://tswracing.net/
Castillo Posted July 20, 2011 Posted July 20, 2011 No, that's wrong. function wasted (thePlayer) local sound = playSound("wasted.mp3",false) setSoundVolume(sound, 0.9) image = guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) setTimer(destroyElement, 5000, 1, image) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wasted ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
SnoopCat Posted July 20, 2011 Author Posted July 20, 2011 isnt working this is the error i get [18:45:18] ERROR: wasted\sonido.lua:7: attempt to call global 'getLocalPlayer' ( a nil value) VISIT TSW RACING SERVER http://tswracing.net/
Castillo Posted July 20, 2011 Posted July 20, 2011 Your script must be set as client side in meta.xml. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted July 21, 2011 Posted July 21, 2011 No, Try, take a look at the wiki example: https://wiki.multitheftauto.com/wiki/OnC ... ayerWasted San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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