INIT.LUA - KING OF THE HILL
AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "cl_init.lua" )
include( 'cl_init.lua' )
function GM:PlayerInitialSpawn( ply )
ply:SetTeam(1)
end
function FragsDeaths( ply )
if ply:Frags() == 20 and ply:Team() == 1 then
ply:SetFrags("0")
ply:SetTeam(2)
ply:Spawn()
ply:SetPos ( Vector( -1025.21, -483.83, 724.70 ) )
ply:SetAngles ( Angle( -0.63, 89.07, 0.00 ) )
elseif ply:Deaths() == 20 and ply:Team() == 2 then
ply:SetTeam(1)
ply:SetFrags("0")
SendMessage(1, "The King of the Hill has been killed and set to the Fighter rank...", "ambient/water/drip" .. math.random(1, 4) .. ".wav")
end
end
function GM:PlayerLoadout( ply )
if ply:Team() == 1 then
ply:Give( "weapon_crowbar" )
ply:Give( "weapon_smg1" )
ply:Give( "weapon_pistol" )
ply:GiveAmmo( 3, "Grenade" true )
ply:GiveAmmo( 45, "Pistol", true )
ply:GiveAmmo( 256, "SMG1", true )
elseif ply:Team() == 2 then
ply:Give( "weapon_crowbar" )
ply:Give( "weapon_smg1" )
ply:Give( "weapon_frag" )
ply:Give( "weapon_stunstick" )
ply:GiveAmmo( 356, "SMG1", true )
ply:GiveAmmo( 55, "Pistol" true )
ply:GiveAmmo( 6, "Grenade" true )
ply:GiveAmmo( 6, "AR2AltFire", true )
end
end
function GM:PlayerNoclip( ply )
if ply:IsSuperAdmin() then
return true
else
return false
end
end
function GM:CanPlayerSuicide( ply )
return false
end
function GM:PlayerSpray( ply )
return false
end
function GM:ShowHelp( ply )
ply:ConCommand( "mainmenu" )
end
CL_INIT.LUA - KING OF THE HILL
include( 'shared.lua' )
local function mainmenu()
local mainmenu = vgui.Create( "DFrame" )
mainmenu:SetPos( ScrW() / 2 - 300, ScrH() / 2 - 300 )
mainmenu:SetSize( 600, 600 )
mainmenu:SetTitle( "King Of The Hill." )
mainmenu:SetVisible( true )
mainmenu:SetDraggable( false )
mainmenu:MakePopup()
local menutabs = vgui.Create( "DPropertySheet" )
menutabs:SetParent( mainmenu )
menutabs:SetPos( 10, 30 )
menutabs:SetSize( 580, 560 )
local welcomepanel = vgui.Create("DPanel")
welcomepanel:SetSize( 550, 480 )
local welcometext = vgui.Create( "DTextEntry" )
welcometext:SetParent( welcomepanel )
welcometext:SetPos( 10,50 )
welcometext:SetTall( 380 )
welcometext:SetWide( 530 )
welcometext:SetDrawBackground( false )
welcometext:SetDrawBorder( false )
welcometext:SetEditable( false )
welcometext:SetEnterAllowed( false )
welcometext:SetMultiline( true )
local text = {}
text[1] = ( "Welcome to the King Of The Hill!\n\n" )
text[2] = ( "The goal of this gamemode is to fight people and work your way to the top of the hill and claim it as your own.\n\n" )
text[3] = ( "Once you get 20 kills, you will be promoted to 'King of the hill', and spawn at the top of the hill.\n\n" )
text[4] = ( "\n\n" )
text[5] = ( "\n\n" )
text[6] = ( "\n\n" )
text[7] = ( "*Please visit JovaCentral.com.*\n" )
text[8] = ( "\n" )
text[9] = ( "\n" )
text[10] = ( "Rules:\n\n" )
text[11] = ( "No Racism\n" )
text[12] = ( "No Cussing\n" )
text[13] = ( "No Spam (Mic, Chat, Etc)\n" )
text[14] = ( "Don't hold up fights.\n" )
text[15] = ( "Obey Superiors\n\n" )
text[16] = ( "If these rules aren't implied, you will be punished." )
welcometext:SetText(table.concat(text))
menutabs:AddSheet( "Welcome", welcomepanel, "gui/silkicons/exclamation", false, false, "Welcome, and get ready to FIGHT!" )
end
concommand.Add( "mainmenu", mainmenu )
-------