when player press button then create new button in a frame
3 replies, posted
Morning,
I have a frame with a DTextEnrty and a send button.
A nice guy who helped me told me this:
"I would add each ticket to a table with a sub-table of all the info and loop through the table creating buttons for each sub-table"
Now I'm really confuised..
Can you help me out with this?
pseudo code
local buttons = {}
local tickets = {
{
reporter = "someone",
fine = 500
}
}
for i = 1, #tickets do
buttons[i] = frame:Add("DButton")
buttons[i]:SetText(v.reporter .. v.fine)
end
in the performlayout do
for i = 1, #buttons do
local button = buttons[i]
-- Check if the button is valid before we continue
-- Or whatever else.
button:SetPos(30, 30 * i)
button:SetSize(w - 30, 30)
end
I think when a player click send with the text, to a table then the info(text) will get into a a sub-table wich creates new loops and the loops are buttons?
This so confuising
Ok I just tried to figger out where to put this now for 1 hour xd
Soo I will describe it better
User:
https://files.facepunch.com/forum/upload/309258/67d1a784-5c8a-45ba-bd3b-cd1385ac028d/Screenshot_46.png
Admin:
https://files.facepunch.com/forum/upload/309258/ac226dfc-2865-4857-a030-8ab16403a82b/Screenshot_47.png
On the admin side will pop up the button with the player name and the argument(rdm,failrp, etc).
If you click the button on the right side will show up the argument, playername and the text.
I really dont now how to do...
Do you have some Recommendations for tutorials?
thx
Sorry, you need to Log In to post a reply to this thread.