Share Pastebin
Guest
Public paste!

Jova

By: a guest | Feb 9th, 2010 | Syntax: Lua | Size: 3.45 KB | Hits: 26 | Expires: Never
Copy text to clipboard
  1. INIT.LUA - KING OF THE HILL
  2.  
  3.  
  4. AddCSLuaFile( "shared.lua" )
  5. AddCSLuaFile( "cl_init.lua" )
  6.  
  7. include( 'cl_init.lua' )
  8.  
  9. function GM:PlayerInitialSpawn( ply )
  10.         ply:SetTeam(1)
  11. end
  12.  
  13. function FragsDeaths( ply )
  14.         if ply:Frags() == 20 and ply:Team() == 1 then
  15.                         ply:SetFrags("0")
  16.                 ply:SetTeam(2)
  17.                         ply:Spawn()
  18.                         ply:SetPos ( Vector( -1025.21, -483.83, 724.70 ) )
  19.                         ply:SetAngles ( Angle( -0.63, 89.07, 0.00 ) )
  20.            elseif ply:Deaths() == 20 and ply:Team() == 2 then    
  21.         ply:SetTeam(1)
  22.                 ply:SetFrags("0")
  23.                         SendMessage(1, "The King of the Hill has been killed and set to the Fighter rank...", "ambient/water/drip" .. math.random(1, 4) .. ".wav")
  24.                 end
  25.         end
  26.  
  27. function GM:PlayerLoadout( ply )
  28.         if ply:Team() == 1 then
  29.                 ply:Give( "weapon_crowbar" )
  30.                 ply:Give( "weapon_smg1" )
  31.                 ply:Give( "weapon_pistol" )
  32.                 ply:GiveAmmo( 3,        "Grenade"       true )
  33.                 ply:GiveAmmo( 45,       "Pistol",       true )
  34.                 ply:GiveAmmo( 256,      "SMG1",         true )
  35.                         elseif ply:Team() == 2 then
  36.                                 ply:Give( "weapon_crowbar" )
  37.                                 ply:Give( "weapon_smg1" )
  38.                                 ply:Give( "weapon_frag" )
  39.                                 ply:Give( "weapon_stunstick" )
  40.                         ply:GiveAmmo( 356,      "SMG1",                 true )
  41.                         ply:GiveAmmo( 55,       "Pistol"                true )
  42.                         ply:GiveAmmo( 6,        "Grenade"               true )
  43.                         ply:GiveAmmo( 6,        "AR2AltFire",   true )
  44.                 end
  45.         end
  46.  
  47. function GM:PlayerNoclip( ply )
  48.         if ply:IsSuperAdmin() then
  49.                 return true
  50.         else
  51.                 return false
  52.         end
  53. end
  54.  
  55. function GM:CanPlayerSuicide( ply )
  56.         return false
  57. end
  58.  
  59. function GM:PlayerSpray( ply )
  60.         return false
  61. end
  62.  
  63. function GM:ShowHelp( ply )
  64.         ply:ConCommand( "mainmenu" )
  65. end
  66.  
  67.  
  68. CL_INIT.LUA - KING OF THE HILL
  69.  
  70.  
  71. include( 'shared.lua' )
  72.  
  73. local function mainmenu()
  74. local mainmenu = vgui.Create( "DFrame" )
  75. mainmenu:SetPos( ScrW() / 2 - 300,  ScrH() / 2 - 300 )
  76. mainmenu:SetSize( 600, 600 )
  77. mainmenu:SetTitle( "King Of The Hill." )
  78. mainmenu:SetVisible( true )
  79. mainmenu:SetDraggable( false )
  80. mainmenu:MakePopup()
  81.  
  82. local menutabs = vgui.Create( "DPropertySheet" )
  83. menutabs:SetParent( mainmenu )
  84. menutabs:SetPos( 10, 30 )
  85. menutabs:SetSize( 580, 560 )
  86.  
  87.         local welcomepanel = vgui.Create("DPanel")
  88.         welcomepanel:SetSize( 550, 480 )
  89.         local welcometext = vgui.Create( "DTextEntry" )
  90.         welcometext:SetParent( welcomepanel )
  91.         welcometext:SetPos( 10,50 )
  92.         welcometext:SetTall( 380 )
  93.         welcometext:SetWide( 530 )
  94.         welcometext:SetDrawBackground( false )
  95.         welcometext:SetDrawBorder( false )
  96.         welcometext:SetEditable( false )
  97.         welcometext:SetEnterAllowed( false )
  98.         welcometext:SetMultiline( true )
  99.        
  100.         local text = {}
  101.         text[1] = ( "Welcome to the King Of The Hill!\n\n" )
  102.         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" )
  103.         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" )
  104.         text[4] = ( "\n\n" )
  105.         text[5] = ( "\n\n" )
  106.         text[6] = ( "\n\n" )
  107.         text[7] = ( "*Please visit JovaCentral.com.*\n" )
  108.         text[8] = ( "\n" )
  109.         text[9] = ( "\n" )
  110.         text[10] = ( "Rules:\n\n" )
  111.         text[11] = ( "No Racism\n" )
  112.         text[12] = ( "No Cussing\n" )
  113.         text[13] = ( "No Spam (Mic, Chat, Etc)\n" )
  114.         text[14] = ( "Don't hold up fights.\n" )
  115.         text[15] = ( "Obey Superiors\n\n" )
  116.         text[16] = ( "If these rules aren't implied, you will be punished." )
  117.        
  118.         welcometext:SetText(table.concat(text))
  119.        
  120. menutabs:AddSheet( "Welcome", welcomepanel, "gui/silkicons/exclamation", false, false, "Welcome, and get ready to FIGHT!" )
  121. end
  122. concommand.Add( "mainmenu", mainmenu )
  123.  
  124. -------