PaulDK Posted April 16, 2014 Share Posted April 16, 2014 Hello Everyone. I need Help. i want if i hit in the pickup the function drawStuff will start can anyone help me and also if you leave in the pickup it will destroy sorry for my Bad English.. Here's the Script.... infoz = createPickup(2000.5545654297, 1538.30, 13.7, 3, 1239, 0, 1) local x,y = guiGetScreenSize() local Text = "This is a Pirate Ship that gives" local Text2 = "Money If you Stay here you will" local Text3 = "Get a lot of Money........." local Text4 = "Created BY : PaulDK" local Text5 = "Keep Calm And Enjoy :)" function drawStuff() dxDrawRectangle ( x/18, y/3, x/3.5, y/3, tocolor ( 0, 0, 0, 180 ) ) dxDrawText ( "INFORMATION", x/6.5, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 0.8, "default-bold" ) dxDrawText ( Text, x/12, y/2.7, x, y, tocolor ( 255, 255, 255, 255 ), 0.9, "clear" ) dxDrawText ( Text2, x/12, y/2.5, x, y, tocolor ( 255, 255, 255, 255 ), 0.9, "clear" ) dxDrawText ( Text3, x/12, y/2.3, x, y, tocolor ( 255, 255, 255, 255 ), 0.9, "clear" ) dxDrawText ( Text4, x/12, y/1.6, x, y, tocolor ( 255, 255, 255, 255 ), 0.9, "clear" ) dxDrawText ( Text5, x/12, y/2, x, y, tocolor ( 255, 0, 0, 255 ), 0.9, "clear" ) end addEventHandler("onClientRender", root, drawStuff) Link to comment
Moderators IIYAMA Posted April 16, 2014 Moderators Share Posted April 16, 2014 try: (not tested) infoz = createPickup(2000.5545654297, 1538.30, 13.7, 3, 1239, 0, 1) local x,y = guiGetScreenSize() local Text = "This is a Pirate Ship that gives" local Text2 = "Money If you Stay here you will" local Text3 = "Get a lot of Money........." local Text4 = "Created BY : PaulDK" local Text5 = "Keep Calm And Enjoy \"{SMILIES_PATH}/icon_smile.gif\" alt=\"\" title=\"Smile\" />" local lastInfoPickupHit = 0 local pickupInfoHandler = false function drawStuff() if lastInfoPickupHit < getTickCount() then if pickupInfoHandler then pickupInfoHandler = false removeEventHandler("onClientRender", root, drawStuff) end end dxDrawRectangle ( x/18, y/3, x/3.5, y/3, tocolor ( 0, 0, 0, 180 ) ) dxDrawText ( "INFORMATION", x/6.5, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 0.8, "default-bold" ) dxDrawText ( Text, x/12, y/2.7, x, y, tocolor ( 255, 255, 255, 255 ), 0.9, "clear" ) dxDrawText ( Text2, x/12, y/2.5, x, y, tocolor ( 255, 255, 255, 255 ), 0.9, "clear" ) dxDrawText ( Text3, x/12, y/2.3, x, y, tocolor ( 255, 255, 255, 255 ), 0.9, "clear" ) dxDrawText ( Text4, x/12, y/1.6, x, y, tocolor ( 255, 255, 255, 255 ), 0.9, "clear" ) dxDrawText ( Text5, x/12, y/2, x, y, tocolor ( 255, 0, 0, 255 ), 0.9, "clear" ) end addEventHandler("onClientPickupHit", infoz, function (player,matchingDimension) if player == localPlayer and matchingDimension then lastInfoPickupHit = getTickCount()+5000 if not pickupInfoHandler then pickupInfoHandler = true addEventHandler("onClientRender", root, drawStuff) end end end) Link to comment
PaulDK Posted April 16, 2014 Author Share Posted April 16, 2014 in the addEventHandler("onClientRender", root, drawwStuff) root = getRootElement() if 1 player hit in the pickup it will show to all... Link to comment
Karuzo Posted April 16, 2014 Share Posted April 16, 2014 No, that doesn't mean that it will show to everyone. That will only show the player which hit the marker. Link to comment
Moderators IIYAMA Posted April 16, 2014 Moderators Share Posted April 16, 2014 in the addEventHandler("onClientRender", root, drawwStuff) root = getRootElement()if 1 player hit in the pickup it will show to all... Events only use the elements of the root which are useful. Since the player-elements are not very useful for rendering every frame............... you don't have to worry about that. 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