xbenny2506x Posted September 18, 2009 Share Posted September 18, 2009 HI! I have add in my Spwan menu the Spawn name as a guiCreateStaticImage. But the problem is when the player Spawn from one point to a other one he see the new and the old Image. Here is my script: Client: function HighJump ( HighJumptext ) if ( HighJumptext ) then destroyElement ( HighJumptext ) end HighJumptext = guiCreateStaticImage(0.22,0.88,0.30,0.08,"menupic/HighJump.png",true) setTimer ( destroyElement, 3000, 1, HighJumptext, source ) end addEvent( "HighJumpasend", true ) addEventHandler( "HighJumpasend", getRootElement(), HighJump ) function WaterJump ( WaterJumptext ) if ( WaterJumptext ) then destroyElement ( WaterJumptext ) end WaterJumptext = guiCreateStaticImage(0.22,0.88,0.30,0.08,"menupic/WaterJump.png",true) setTimer ( destroyElement, 3000, 1, WaterJumptext, source ) end addEvent( "WaterJumpsend", true ) addEventHandler( "WaterJumpsend", getRootElement(), WaterJump ) Server: ... if ( check ) == 999 then triggerClientEvent ( source,"HighJumpasend", getRootElement()) ... if ( check ) == 9999 then triggerClientEvent ( source,"WaterJumpsend", getRootElement()) ... Can somone Help me with that problem? THX Link to comment
Remp Posted September 18, 2009 Share Posted September 18, 2009 assuming i understand you correctly, could you not just check for other images when you show one, eg: function HighJump ( HighJumptext ) CheckOnScreenText() HighJumptext = guiCreateStaticImage(0.22,0.88,0.30,0.08,"menupic/HighJump.png",true) HighJumpTimer = setTimer ( destroyElement, 3000, 1, HighJumptext, source ) end addEvent( "HighJumpasend", true ) addEventHandler( "HighJumpasend", getRootElement(), HighJump ) function WaterJump ( WaterJumptext ) CheckOnScreenText() WaterJumptext = guiCreateStaticImage(0.22,0.88,0.30,0.08,"menupic/WaterJump.png",true) WaterJumpTimer = setTimer ( destroyElement, 3000, 1, WaterJumptext, source ) end addEvent( "WaterJumpsend", true ) addEventHandler( "WaterJumpsend", getRootElement(), WaterJump ) function CheckOnScreenText() if ( WaterJumpText ) then destroyElement ( WaterJumpText ) WaterJumpText = nil if WaterJumpTimer then killTimer(WaterJumpTimer) WaterJumpTimer = nil end end if ( HighJumptext ) then destroyElement ( HighJumptext ) HighJumptext = nil if HighJumpTimer then killTimer(HighJumpTimer) HighJumpTimer = nil end end end Link to comment
50p Posted September 19, 2009 Share Posted September 19, 2009 Why don't you just load a new image? You can have 1 gui-staticimage element (especially if images are meant to be in the same position) and load another image to swap the image. - https://wiki.multitheftauto.com/index.ph ... eLoadImage Also, what is source doing in setTimer for destroyElement? destroyElement has only 1 parameter. Link to comment
xbenny2506x Posted September 19, 2009 Author Share Posted September 19, 2009 THX 50p i have seen this last night too. You have right so its easy and my script work now THX 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