Turbe$Z

Why not working settimer?

Recommended Posts

addEventHandler("onClientRender", root,
addEventHandler("onClientGUIClick", GUIEditor.button[1], function()
text1 = guiGetText(GUIEditor.edit[1])
--text2 = guiGetText(valasz1)
--text3 = guiGetText(valasz2)
if text1 ~= "" then
--triggerServerEvent("server",localPlayer,text1)
    dxDrawText(text1, (screenW * 0.2924) + 1, (screenH * 0.3778) + 1, (screenW * 0.7014) + 1, (screenH * 0.5400) + 1, tocolor(0, 0, 0, 255), 2.50, "default-bold", "left", "top", false, true, false, false, false)
    dxDrawText(text1, screenW * 0.2924, screenH * 0.3778, screenW * 0.7014, screenH * 0.5400, tocolor(255, 0, 0, 255), 2.50, "default-bold", "left", "top", false, true, false, false, false)
	setTimer ( function()
	text1 = nil
	end, 5000, 1 )
end
end
)
)

what wrong in this?

Share this post


Link to post

I'm not sure what are you trying to do but add render event then on gui click event makes no sense and wrong way to do something.

and text1 defined where so after 5 seconds you want to make text1 empty?

Share this post


Link to post

I'm not sure if that what you want but try this :

 

addEventHandler("onClientGUIClick", GUIEditor.button[1], 
    function (      )
        text1 = guiGetText ( GUIEditor.edit[1] )
        text2 = guiGetText ( valasz1 )
        text3 = guiGetText ( valasz2 )
    if text1 ~= "" then
        triggerServerEvent( "server",localPlayer,text1 )
    setTimer ( 
            function(       )
                text1 = nil
         end,5000, 1 )
    end
end,false
)

addEventHandler ( 'onClientRender',root,
    function (  )
        dxDrawText(text1, (screenW * 0.2924) + 1, (screenH * 0.3778) + 1, (screenW * 0.7014) + 1, (screenH * 0.5400) + 1, tocolor(0, 0, 0, 255), 2.50, "default-bold", "left", "top", false, true, false, false, false)
        dxDrawText(text1, screenW * 0.2924, screenH * 0.3778, screenW * 0.7014, screenH * 0.5400, tocolor(255, 0, 0, 255), 2.50, "default-bold", "left", "top", false, true, false, false, false)
    end
)

 

Share this post


Link to post
2 minutes ago, FaHaD said:

I'm not sure if that what you want but try this :

 


addEventHandler("onClientGUIClick", GUIEditor.button[1], 
    function (      )
        text1 = guiGetText ( GUIEditor.edit[1] )
        text2 = guiGetText ( valasz1 )
        text3 = guiGetText ( valasz2 )
    if text1 ~= "" then
        triggerServerEvent( "server",localPlayer,text1 )
    setTimer ( 
            function(       )
                text1 = nil
         end,5000, 1 )
    end
end,false
)

addEventHandler ( 'onClientRender',root,
    function (  )
        dxDrawText(text1, (screenW * 0.2924) + 1, (screenH * 0.3778) + 1, (screenW * 0.7014) + 1, (screenH * 0.5400) + 1, tocolor(0, 0, 0, 255), 2.50, "default-bold", "left", "top", false, true, false, false, false)
        dxDrawText(text1, screenW * 0.2924, screenH * 0.3778, screenW * 0.7014, screenH * 0.5400, tocolor(255, 0, 0, 255), 2.50, "default-bold", "left", "top", false, true, false, false, false)
    end
)

 

Thanks man :DD

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.