Jump to content

MTA GUI Buttons


Recommended Posts

xfsMlKt.png

Well, I want to type 5 numbers, maximum integer 5 and basically the person is meant to type but I cant get it to type, so far when the person presses the certain button it only appears that number. Can someone help me?

e.g.

'Person presses 1, 4, 2, 1'

It will appear in the GUI Edit

Link to comment

add a number to the table like this:

local numberTable = {} 
addEventHandler("onClientGUIClick", Button1, function() 
   if #numberTable < 6 then 
      table.insert(numberTable, 1) 
   end 
end) 
  

i dont know why are you using edit box, just simply write out with a label. You can write out like this:

  
 addEventHandler("onClientRender", root, function() 
 dxDrawText(table.concat(numberTable), --rest of dxText) 
end) 
  

Or you can use guilabel or set the text of the edit box without onClientRender.

Link to comment

i said it right then...

local table = {} 
addEventHandler("onClientGUIClick", button1, function() 
  if #table <= 5 then 
     table.insert(table, 5) 
  end 
end) 

wirte the value...

  
 dxDrawText(table.concat(table)) -- write it like this: table.concat(tablename) 
  

you can do this with edit box, just set the text of the edit box like this

  
 guiSetText(edit, table.concat(table)) 
  

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