Hello Facepunch
I’ve recently decided to remake the old f4 menu into darkrp, while doing so i’m coming through a little trubble myself as I’m a little rusty to gLua. You’ll be able to see in the picture below as to how the icons are suppose to be underneath each other, they should be a row of 6 per line.
Image: http://prntscr.com/gniavb
Code in which makes the icons.
// I’m unsure on how to make it 6 icons per line, any help?
[LUA]
for k, v in pairs( RPExtraTeams ) do
local icon = vgui.Create(“SpawnIcon”, tab2panel)
icon:SetSize(64,64)
icon:SetModel( v.model[1] )
icon:SetToolTip(v.name)
icon:SetPos(k+k*icon:GetWide()-icon:GetWide(),0)
icon.DoClick = function()
RunConsoleCommand("say", "/".. v.command) -- sets the players team when icons is clicked.
end
print(k)
end
[/LUA]
Your help will be greatly appreciated, thanks!