1. AddCSLuaFile( "shared.lua" )
  2. AddCSLuaFile( "cl_init.lua" )
  3.  
  4. include( "shared.lua" )
  5. --include( "teams/runners.lua" )
  6. --include( "teams/gunners.lua" )
  7. --include( "playermodel.lua" )
  8.  
  9.  
  10.  
  11. game.ConsoleCommand("cl_phys_timescale 0.2 \n") --slomo death effect
  12.  
  13. function Assign( ply ) -- the probablity of being a gunner is 1/3
  14.  
  15. varRand = math.random( 1, 3 )
  16. ply:UnSpectate()
  17. if varRand == 1 then
  18. run_team1( ply )
  19. elseif varRand == 2 then
  20. run_team1( ply )
  21. else
  22. run_team2( ply )
  23. end
  24. Msg( "You, " .. ply:Nick() .. ", joined team " .. ply:Team() .. " \n")
  25.  
  26. end
  27.  
  28. function GM:PlayerSpawn( ply )
  29.  
  30. ply:SetMaxHealth( 100, true )
  31. Assign( ply )
  32. ply:SetWalkSpeed( 325 )
  33. ply:SetRunSpeed( 325 )
  34.  
  35. end
  36.  
  37. function run_team1( ply )
  38.  
  39. ply:SetTeam( 1 )
  40. ply:Spawn()
  41. ply:PrintMessage( HUD_PRINTTALK, "Welcome to 'RUN!', " .. ply:Nick() .. ". You are on team runner.")
  42.  
  43. end
  44.  
  45. function run_team2( ply )
  46.  
  47. ply:UnSpectate()
  48. ply:SetTeam( 2 )
  49. ply:Spawn()
  50. ply:PrintMessage( HUD_PRINTTALK, "Welcome to 'RUN!', " .. ply:Nick() .. ". You are on team gunner.")
  51.  
  52. end
  53.  
  54. function run_spectator( ply )
  55.  
  56. ply:Spectate( OBS_MODE_ROAMING )
  57. ply:SetTeam( 3 )
  58. ply:PrintMessage( HUD_PRINTTALK, "You are a spectater, " .. ply:Nick() .. ".")
  59.  
  60. end
  61.  
  62.  
  63.  
  64. function GM:DoPlayerDeath( victim, killer, dmginfo )
  65.  
  66. victim:CreateRagdoll()
  67. victim:AddDeaths( 1 )
  68. run_spectator( victim )
  69.  
  70. if killer:IsValid() && killer:IsPlayer() then
  71. victim:PrintMessage( HUD_PRINTTALK, "You are DEAD, and you killed yourself, " .. victim:Nick() .. "! \n")
  72. killer:AddFrags( -1 )
  73. else
  74. victim:PrintMessage( HUD_PRINTTALK, "You are DEAD, " .. victim:Nick() .. "! " .. killer:GetNick() .. " recieved +1 bullets \n")
  75. killer:GiveAmmo( 1, "smg1" )
  76. killer:AddFrags( 1 )
  77.  
  78. end
  79.  
  80.  
  81. end
  82.  
  83. function GM:PlayerNoClip( ply )
  84.  
  85. local oldstate = ply:GetMoveType()
  86.  
  87. if oldstate != MOVETYPE_NOCLIP then
  88.  
  89. return false
  90.  
  91. end
  92.  
  93. return true
  94.  
  95. end
  96.  
  97. function GM:PlayerDeath( ply )
  98. local respawnloop = os.time
  99. end
  100.  
  101. function GM:PlayerDeathThink( ply )
  102.  
  103. if ( respawnloop > respawnloop - 5 ) then ply:spawn()
  104. end
  105.  
  106. end
  107.  
  108. function WhatTeam( ply )
  109. local teaminfo = ply:Team()
  110. local teaminfoname = team.GetName( teaminfo )
  111. ply:PrintMessage(HUD_PRINTTALK, "Your are on team '" .. teaminfoname )
  112. end
  113.  
  114. function GM:PlayerLoadout( ply ) --what the player gets
  115. if ply:Team() == 2 then
  116. ply:Give( "weapon_pistol" )
  117. ply:SetAmmo( 3, "Pistol" )
  118. end
  119. end
  120.  
  121. --group01
  122. util.PrecacheModel( "models/player/Group01/Male_01.mdl" )
  123. util.PrecacheModel( "models/player/Group01/male_02.mdl" )
  124. util.PrecacheModel( "models/player/Group01/male_03.mdl" )
  125. util.PrecacheModel( "models/player/Group01/Male_04.mdl" )
  126. util.PrecacheModel( "models/player/Group01/Male_05.mdl" )
  127. util.PrecacheModel( "models/player/Group01/male_06.mdl" )
  128. util.PrecacheModel( "models/player/Group01/male_07.mdl" )
  129. util.PrecacheModel( "models/player/Group01/male_08.mdl" )
  130. util.PrecacheModel( "models/player/Group01/male_09.mdl" )
  131. --group03
  132. util.PrecacheModel( "models/player/Group03/Male_01.mdl" )
  133. util.PrecacheModel( "models/player/Group03/male_02.mdl" )
  134. util.PrecacheModel( "models/player/Group03/male_03.mdl" )
  135. util.PrecacheModel( "models/player/Group03/male_04.mdl" )
  136. util.PrecacheModel( "models/player/Group03/male_05.mdl" )
  137. util.PrecacheModel( "models/player/Group03/male_06.mdl" )
  138. util.PrecacheModel( "models/player/Group03/male_07.mdl" )
  139. util.PrecacheModel( "models/player/Group03/male_08.mdl" )
  140. util.PrecacheModel( "models/player/Group03/male_09.mdl" )
  141. --gunners
  142. util.PrecacheModel( "models/player/Combine_Super_soldier.mdl" )
  143.  
  144. Plymodels={}
  145. Plymodels[1]= "models/player/Group01/Male_01.mdl"
  146. Plymodels[2]= "models/player/Group01/male_02.mdl"
  147. Plymodels[3]= "models/player/Group01/male_03.mdl"
  148. Plymodels[4]= "models/player/Group01/Male_04.mdl"
  149. Plymodels[5]= "models/player/Group01/Male_05.mdl"
  150. Plymodels[6]= "models/player/Group01/male_06.mdl"
  151. Plymodels[7]= "models/player/Group01/male_07.mdl"
  152. Plymodels[8]= "models/player/Group01/male_08.mdl"
  153. Plymodels[9]= "models/player/Group03/male_09.mdl"
  154.  
  155. Plymodels[10]= "models/player/Group03/Male_01.mdl"
  156. Plymodels[11]= "models/player/Group03/male_02.mdl"
  157. Plymodels[12]= "models/player/Group03/male_03.mdl"
  158. Plymodels[13]= "models/player/Group03/male_04.mdl"
  159. Plymodels[14]= "models/player/Group03/male_05.mdl"
  160. Plymodels[15]= "models/player/Group03/male_06.mdl"
  161. Plymodels[16]= "models/player/Group03/male_07.mdl"
  162. Plymodels[17]= "models/player/Group03/male_08.mdl"
  163. Plymodels[18]= "models/player/Group03/male_09.mdl"
  164.  
  165. function GM:PlayerSetModel( ply )
  166. if ply:Team() == 1 then
  167. ply:SetModel( table.Random( Plymodels ) )
  168. -- elseif ply:SteamID() == "STEAM_0:0:19655882"
  169. -- ply:SetModel( "models/player/Group01/Male_01.mdl" )
  170. else
  171. ply:SetModel( "models/player/Combine_Super_soldier.mdl" ) --DO NOT CHANGE
  172. end
  173.  
  174.  
  175. end
  176.  
  177.  
  178.  
  179.  
  180. concommand.Add( "run_team1", run_team1 )
  181. concommand.Add( "run_team2", run_team2 )
  182. concommand.Add( "run_spectate", run_spectator )
  183. concommand.Add( "run_whatteam", WhatTeam )
  184. concommand.Add( "roundtype", DRoundType )
  185.  
  186.