Jump to content

GUI Help


mint3d

Recommended Posts

Posted

I need help it doesn't close the dx

local x,y = guiGetScreenSize() 
local playerName = getPlayerName ( localPlayer ) 
local MOTDText = "Welcome to our server!" 
  
function drawStuff () 
dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) 
dxDrawText ( "Welcome " .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) 
dxDrawText ( MOTDText, x/3.6, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 1, "clear" ) -- Create MOTD text. 
end 
  
addEventHandler("onClientRender", getRootElement(), drawStuff) 
  
function closedrawStuff () 
removeEventHandler("onClientRender",getRootElement(),drawStuff) 
end 
  
addEventHandler("onClientGUIClick",bLogin,closedrawStuff) 
  

Skype: Jordan_Nymph

Posted

Where's "bLogin" defined?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted (edited)

the same script

    bLogin = guiCreateButton(50, 200, 210, 46, "Login", false, wLogin) 
    guiSetFont(bLogin, "default-bold-small") 
    addEventHandler("onClientGUIClick", bLogin, LoginScreen_validateLogin, false) 

Edited by Guest

Skype: Jordan_Nymph

Posted

Add an outputChatBox to see if the function is being executed.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
local x,y = guiGetScreenSize() 
local playerName = getPlayerName ( localPlayer ) 
local MOTDText = "Welcome to our server!" 
  
function drawStuff () 
dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) 
dxDrawText ( "Welcome " .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) 
dxDrawText ( MOTDText, x/3.6, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 1, "clear" ) -- Create MOTD text. 
end 
  
addEventHandler("onClientRender", getRootElement(), drawStuff) 
  
function closedrawStuff () 
removeEventHandler("onClientRender",getRootElement(),drawStuff) 
outputChatBox ( "#FF0000Hello #00FF00World", getRootElement(), 255, 255, 255, true ) 
end 
  
addEventHandler("onClientGUIClick",bLogin,closedrawStuff) 
  

Didn't out put anything

Skype: Jordan_Nymph

Posted

Do you get any errors on the debugscript? is "bLogin" created outside any function?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

bLogin is created in a different function and its created on the gui function which is this function LoginScreen_openLoginScreen()

Skype: Jordan_Nymph

Posted

Then, put the onClientGUIClick addEventHandler after you create the button ( inside the same function ).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...