Okay, so i have this game where there are two teams, and when you spawn you choose your team, and it resets your stuff
i need a way to add 2 teams to the menu, but if they aren't donator in ulx or something they can't choose it
Please Help!
Thanks :)
[url]http://coderhire.com[/url]
Here's a very basic version of what you asked. Make sure to change the NAME OF VIP GROUP
[LUA]if CLIENT then
function hi()
local p = vgui.Create('DFrame')
p:SetSize(400, 200)
p:SetTitle("Teams")
p:SetSizable(false)
p:SetDeleteOnClose(false)
p:Center()
p:MakePopup()
local button1 = vgui.Create("DButton")
button1:SetParent( p )
button1:SetPos(100, 35)
button1:SetFont("default")
button1:SetText("Join team 1")
button1:SetSize(100, 25)
button1.DoClick = function()
if !LocalPlayer():IsUserGroup("NAME OF VIP GROUP") then
LocalPlayer():ChatPrint("This is for donators only!!!")
return false
end
RunConsoleCommand( "jointeam", "1" )
end
local button2 = vgui.Create("DButton")
button2:SetParent( p )
button2:SetPos(200, 35) -- x, y
button2:SetFont("default") -- Use our custom font we made above.
button2:SetText("Join team 2") -- Well you get the point.
button2:SetSize(100, 25) -- I thought this was a okay size
button2.DoClick = function()
if !LocalPlayer():IsUserGroup("NAME OF VIP GROUP") then
LocalPlayer():ChatPrint("This is for donators only!!!")
return false
end
RunConsoleCommand( "jointeam", "2" )
end
end
concommand.Add("joining", hi)
elseif SERVER then
function joined(ply)
ply:ConCommand("joining")
end
hook.Add("PlayerAuthed", "joined", joined)
function join(ply, cmd, args)
if args[1] == "1" then
ply:SetTeam(1)
-- ADD ANYTHING ELSE YOU WANT HERE
elseif args[1] == "2" then
ply:SetTeam(2)
-- ADD ANYTHING ELSE YOU WANT HERE
end
end
concommand.Add("jointeam", join)
end
team.SetUp(1, "Team1", Color(255, 255, 255, 255))
team.SetUp(2, "Team2", Color(0, 0, 0, 255))[/LUA]
Sorry, you need to Log In to post a reply to this thread.