This is my cl_init.lua
include( 'shared.lua' ) --Tell the client to load shared.lua
-------------------------------------------------------------------
function set_team()
local frame = vgui.Create( "DFrame" )
frame:SetPos( ScrH() / 2, ScrW() / 2 ) --Set the window in the middle of the players screen/game window
frame:SetSize( 200, 210 ) --Set the size
frame:SetTitle( "Change Class" ) --Set title
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )
frame:MakePopup()
-- Team 1 "Civilian"
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( frame:GetTall() / 2, 5 ) --Place it half way on the tall and 5 units in horizontal
team_1:SetSize( 50, 100 )
team_1:SetText( "Civilian" )
team_1.DoClick = function() --Make the player join team 1
RunConsoleCommand( "team_1" )
end
-- Team 2 "Soldier"
team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( frame:GetTall() / 2, 105 ) --Place it next to our previous one
team_2:SetSize( 50, 100 )
team_2:SetText( "[NoR] Soldier" )
team_2.DoClick = function() --Make the player join team 2
RunConsoleCommand( "team_2" )
end
-- Team 3 "Sniper"
team_3 = vgui.Create( "DButton", frame )
team_3:SetPos( frame:GetTall() / 2, 105 ) --Place it next to our previous one
team_3:SetSize( 50, 100 )
team_3:SetText( "[NoR] Sniper" )
team_3.DoClick = function()
RunConsoleCommand( "team_3" )
end
-- Team 4 "Medic"
team_4 = vgui.Create( "DButton", frame )
team_4:SetPos( frame:GetTall() / 2, 105 )
team_4:SetSize( 50, 100 )
team_4:SetText( "[NoR] Medic" )
team_4.DoClick = function()
RunConsoleCommand( "team_4" )
end
-- Team 5 "Support"
team_5 = vgui.Create( "DButton", frame )
team_5:SetPos( frame:GetTall() / 2, 105 )
team_5:SetSize( 50, 100 )
team_5:SetText( "[NoR] Support" )
team_5.DoClick = function()
RunConsoleCommand( "team_5" )
end
-- Team 6 "Engineer"
team_6 = vgui.Create( "DButton", frame )
team_6:SetPos( frame:GetTall() / 2, 105 )
team_6:SetSize( 50, 100 )
team_6:SetText( "[Nor] Engineer" )
team_6.DoClick = function()
RunConsoleCommand( "team_6" )
end
-- Team 7 "Pilot"
team_7 = vgui.Create( "DButton", frame )
team_7:SetPos( frame:GetTall() / 2, 105 )
team_7:SetSize( 50, 100 )
team_7:SetText( "[NoR] Pilot" )
team_7.DoClick = function()
RunConsoleCommand( "team_7" )
end
end
concommand.Add( "team_menu", set_team )
----------------------------------------------------------------------------------------------
--Other
function Init_Gamemode()
Msg( "Hey" )
end
hook.Add( "Initialize", "initializing", Init_Gamemode );
function GM:InitPostEntity ()
end
function GM:RenderScreenspaceEffects ()
end
NextPrintTime = 0
function SecondPrint()
if (CurTime() >= NextPrintTime) then
Msg("This is printed every second
")
NextPrintTime = CurTime() + 1
end
end
hook.Add("Think", "SecondPrint", SecondPrint)
function playerDies( victim, weapon, killer )
Msg( "Player " .. victim:GetName() .. " has died."
);
end
hook.Add( "PlayerDeath", "playerDeathTest", playerDies
Anything wrong with it? Please let me know, and what is wrong… Thank You!
PS. You don’t want to steal this gamemode… Eventought there is nothing you can’t find out for yourself in there, if I made it this faar, I know you will to… lol