Jump to content

Why not working settimer?


Turbe$Z

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?

Link to comment

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
)

 

Link to comment
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

Link to comment

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.
×
×
  • Create New...