diff --git a/gamemodes/prop_hunt/backgrounds/cs_office.jpg b/gamemodes/prop_hunt/backgrounds/cs_office.jpg new file mode 100644 index 0000000..238f3f3 Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/cs_office.jpg differ diff --git a/gamemodes/prop_hunt/backgrounds/cs_office_2.jpg b/gamemodes/prop_hunt/backgrounds/cs_office_2.jpg new file mode 100644 index 0000000..051cbec Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/cs_office_2.jpg differ diff --git a/gamemodes/prop_hunt/backgrounds/elementary_school.jpg b/gamemodes/prop_hunt/backgrounds/elementary_school.jpg new file mode 100644 index 0000000..f4e7b0e Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/elementary_school.jpg differ diff --git a/gamemodes/prop_hunt/backgrounds/elementary_school_2.jpg b/gamemodes/prop_hunt/backgrounds/elementary_school_2.jpg new file mode 100644 index 0000000..5ef7ded Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/elementary_school_2.jpg differ diff --git a/gamemodes/prop_hunt/backgrounds/office.jpg b/gamemodes/prop_hunt/backgrounds/office.jpg new file mode 100644 index 0000000..7703ce2 Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/office.jpg differ diff --git a/gamemodes/prop_hunt/backgrounds/ph_islandhouse0013.jpg b/gamemodes/prop_hunt/backgrounds/ph_islandhouse0013.jpg new file mode 100644 index 0000000..76cd1a0 Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/ph_islandhouse0013.jpg differ diff --git a/gamemodes/prop_hunt/backgrounds/restaurant.jpg b/gamemodes/prop_hunt/backgrounds/restaurant.jpg new file mode 100644 index 0000000..cc26b6d Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/restaurant.jpg differ diff --git a/gamemodes/prop_hunt/backgrounds/starship.jpg b/gamemodes/prop_hunt/backgrounds/starship.jpg new file mode 100644 index 0000000..28a0a5b Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/starship.jpg differ diff --git a/gamemodes/prop_hunt/backgrounds/underwater.jpg b/gamemodes/prop_hunt/backgrounds/underwater.jpg new file mode 100644 index 0000000..96bad5d Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/underwater.jpg differ diff --git a/gamemodes/prop_hunt/backgrounds/zombiebunker.jpg b/gamemodes/prop_hunt/backgrounds/zombiebunker.jpg new file mode 100644 index 0000000..0d2d4bd Binary files /dev/null and b/gamemodes/prop_hunt/backgrounds/zombiebunker.jpg differ diff --git a/gamemodes/prop_hunt/entities/entities/ph_prop/cl_init.lua b/gamemodes/prop_hunt/entities/entities/ph_prop/cl_init.lua index a5bbb73..7246c62 100644 --- a/gamemodes/prop_hunt/entities/entities/ph_prop/cl_init.lua +++ b/gamemodes/prop_hunt/entities/entities/ph_prop/cl_init.lua @@ -1,8 +1,8 @@ -// Include needed files -include("shared.lua") - - -// Called every frame? -function ENT:Draw() - self.Entity:DrawModel() +// Include needed files +include("shared.lua") + + +// Called every frame? +function ENT:Draw() + self.Entity:DrawModel() end \ No newline at end of file diff --git a/gamemodes/prop_hunt/entities/entities/ph_prop/init.lua b/gamemodes/prop_hunt/entities/entities/ph_prop/init.lua index b6c0f54..1ac5680 100644 --- a/gamemodes/prop_hunt/entities/entities/ph_prop/init.lua +++ b/gamemodes/prop_hunt/entities/entities/ph_prop/init.lua @@ -1,57 +1,55 @@ -//Thanks to Blasteh for gmod update the fix and nifnat for spectate fix! - -// Send required files to client -AddCSLuaFile("cl_init.lua") -AddCSLuaFile("shared.lua") - - -// Include needed files -include("shared.lua") - - -// Called when the entity initializes -function ENT:Initialize() - self:SetModel("models/player/Kleiner.mdl") - self.health = 100 -end - - -// Called when we take damge -function ENT:OnTakeDamage(dmg) - local pl = self:GetOwner() - local attacker = dmg:GetAttacker() - local inflictor = dmg:GetInflictor() - - // Health - if pl && pl:IsValid() && pl:Alive() && pl:IsPlayer() && attacker:IsPlayer() && dmg:GetDamage() > 0 then - self.health = self.health - dmg:GetDamage() - pl:SetHealth(self.health) - - if self.health <= 0 then - pl:KillSilent() - - if inflictor && inflictor == attacker && inflictor:IsPlayer() then - inflictor = inflictor:GetActiveWeapon() - if !inflictor || inflictor == NULL then inflictor = attacker end - end - - pl:RemoveProp() // Needs to be executed before net.Broadcast - net.Start( "PlayerKilledByPlayer" ) - - net.WriteEntity( pl ) - net.WriteString( inflictor:GetClass() ) - net.WriteEntity( attacker ) - - net.Broadcast() - - - MsgAll(attacker:Name() .. " found and killed " .. pl:Name() .. "\n") - - attacker:AddFrags(1) - pl:AddDeaths(1) - attacker:SetHealth(math.Clamp(attacker:Health() + GetConVar("HUNTER_KILL_BONUS"):GetInt(), 1, 100)) - - - end - end -end + +// Send required files to client +AddCSLuaFile("cl_init.lua") +AddCSLuaFile("shared.lua") + + +// Include needed files +include("shared.lua") + + +// Called when the entity initializes +function ENT:Initialize() + self:SetModel("models/player/Kleiner.mdl") + self.health = 100 +end + + +// Called when we take damge +function ENT:OnTakeDamage(dmg) + local pl = self:GetOwner() + local attacker = dmg:GetAttacker() + local inflictor = dmg:GetInflictor() + + // Health + if pl && pl:IsValid() && pl:Alive() && pl:IsPlayer() && attacker:IsPlayer() && dmg:GetDamage() > 0 then + self.health = self.health - dmg:GetDamage() + pl:SetHealth(self.health) + + if self.health <= 0 then + pl:KillSilent() + + if inflictor && inflictor == attacker && inflictor:IsPlayer() then + inflictor = inflictor:GetActiveWeapon() + if !inflictor || inflictor == NULL then inflictor = attacker end + end + + net.Start( "PlayerKilledByPlayer" ) + + net.WriteEntity( pl ) + net.WriteString( inflictor:GetClass() ) + net.WriteEntity( attacker ) + + net.Broadcast() + + + MsgAll(attacker:Name() .. " found and killed " .. pl:Name() .. "\n") + + attacker:AddFrags(1) + pl:AddDeaths(1) + attacker:SetHealth(math.Clamp(attacker:Health() + GetConVar("HUNTER_KILL_BONUS"):GetInt(), 1, 100)) + + pl:RemoveProp() + end + end +end \ No newline at end of file diff --git a/gamemodes/prop_hunt/entities/entities/ph_prop/shared.lua b/gamemodes/prop_hunt/entities/entities/ph_prop/shared.lua index a300eb5..f9472ad 100644 --- a/gamemodes/prop_hunt/entities/entities/ph_prop/shared.lua +++ b/gamemodes/prop_hunt/entities/entities/ph_prop/shared.lua @@ -1,3 +1,3 @@ -// Entity information -ENT.Type = "anim" +// Entity information +ENT.Type = "anim" ENT.Base = "base_anim" \ No newline at end of file diff --git a/gamemodes/prop_hunt/gamemode/cl_init.lua b/gamemodes/prop_hunt/gamemode/cl_init.lua index e53026f..01f5195 100644 --- a/gamemodes/prop_hunt/gamemode/cl_init.lua +++ b/gamemodes/prop_hunt/gamemode/cl_init.lua @@ -1,111 +1,116 @@ -// Include the needed files -include("sh_init.lua") -//include("cl_hints.lua") - -// Decides where the player view should be (forces third person for props) -function GM:CalcView(pl, origin, angles, fov) - local view = {} - - if blind then - view.origin = Vector(20000, 0, 0) - view.angles = Angle(0, 0, 0) - view.fov = fov - - return view - end - - view.origin = origin - view.angles = angles - view.fov = fov - - // Give the active weapon a go at changing the viewmodel position - if pl:Team() == TEAM_PROPS && pl:Alive() then - view.origin = origin + Vector(0, 0, hullz - 60) + (angles:Forward() * -80) - else - local wep = pl:GetActiveWeapon() - if wep && wep != NULL then - local func = wep.GetViewModelPosition - if func then - view.vm_origin, view.vm_angles = func(wep, origin*1, angles*1) // Note: *1 to copy the object so the child function can't edit it. - end - - local func = wep.CalcView - if func then - view.origin, view.angles, view.fov = func(wep, pl, origin*1, angles*1, fov) // Note: *1 to copy the object so the child function can't edit it. - end - end - end - - return view -end - - -// Draw round timeleft and hunter release timeleft -function HUDPaint() - if GetGlobalBool("InRound", false) then - local blindlock_time_left = (GetConVar("HUNTER_BLINDLOCK_TIME"):GetInt() - (CurTime() - GetGlobalFloat("RoundStartTime", 0))) + 1 - - if blindlock_time_left < 1 && blindlock_time_left > -6 then - blindlock_time_left_msg = "Hunters have been released!" - elseif blindlock_time_left > 0 then - blindlock_time_left_msg = "Hunters will be unblinded and released in "..string.ToMinutesSeconds(blindlock_time_left) - else - blindlock_time_left_msg = nil - end - - if blindlock_time_left_msg then - surface.SetFont("MyFont") - local tw, th = surface.GetTextSize(blindlock_time_left_msg) - - draw.RoundedBox(8, 20, 20, tw + 20, 26, Color(0, 0, 0, 75)) - draw.DrawText(blindlock_time_left_msg, "MyFont", 31, 26, Color(255, 255, 0, 255), TEXT_ALIGN_LEFT) - end - end -end -hook.Add("HUDPaint", "PH_HUDPaint", HUDPaint) - - -// Called immediately after starting the gamemode -function Initialize() - hullz = 80 - //surface.CreateFont("Arial", 14, 1200, true, false, "ph_arial") - surface.CreateFont( "MyFont", - { - font = "Arial", - size = 14, - weight = 1200, - antialias = true, - underline = false - }) -end -hook.Add("Initialize", "PH_Initialize", Initialize) - - -// Resets the player hull -function ResetHull(um) - if LocalPlayer() && LocalPlayer():IsValid() then - LocalPlayer():ResetHull() - hullz = 80 - end -end -usermessage.Hook("ResetHull", ResetHull) - - -// Sets the local blind variable to be used in CalcView -function SetBlind(um) - blind = um:ReadBool() -end -usermessage.Hook("SetBlind", SetBlind) - - -// Sets the player hull -function SetHull(um) - hullxy = um:ReadLong() - hullz = um:ReadLong() - new_health = um:ReadLong() - - LocalPlayer():SetHull(Vector(hullxy * -1, hullxy * -1, 0), Vector(hullxy, hullxy, hullz)) - LocalPlayer():SetHullDuck(Vector(hullxy * -1, hullxy * -1, 0), Vector(hullxy, hullxy, hullz)) - LocalPlayer():SetHealth(new_health) -end -usermessage.Hook("SetHull", SetHull) +include("sh_init.lua") + +// Decides where the player view should be (forces third person for props) +function GM:CalcView(pl, origin, angles, fov) + local view = {} + + if blind then + view.origin = Vector(20000, 0, 0) + view.angles = Angle(0, 0, 0) + view.fov = fov + + return view + end + + view.origin = origin + view.angles = angles + view.fov = fov + + // Give the active weapon a go at changing the viewmodel position + if pl:Team() == TEAM_PROPS && pl:Alive() then + view.origin = origin + Vector(0, 0, hullz - 60) + (angles:Forward() * -80) + else + local wep = pl:GetActiveWeapon() + if wep && wep != NULL then + local func = wep.GetViewModelPosition + if func then + view.vm_origin, view.vm_angles = func(wep, origin*1, angles*1) // Note: *1 to copy the object so the child function can't edit it. + end + + local func = wep.CalcView + if func then + view.origin, view.angles, view.fov = func(wep, pl, origin*1, angles*1, fov) // Note: *1 to copy the object so the child function can't edit it. + end + end + end + + return view +end + + +// Draw round timeleft and hunter release timeleft +function HUDPaint() + if GetGlobalBool("InRound", false) then + local blindlock_time_left = (HUNTER_BLINDLOCK_TIME - (CurTime() - GetGlobalFloat("RoundStartTime", 0))) + 1 + + if blindlock_time_left < 1 && blindlock_time_left > -6 then + blindlock_time_left_msg = "Ready or not, here we come!" + elseif blindlock_time_left > 0 then + blindlock_time_left_msg = "Hunters will be unblinded and released in "..string.ToMinutesSeconds(blindlock_time_left) + else + blindlock_time_left_msg = nil + end + + if blindlock_time_left_msg then + surface.SetFont("MyFont") + local tw, th = surface.GetTextSize(blindlock_time_left_msg) + + draw.RoundedBox(8, 20, 20, tw + 20, 26, Color(0, 0, 0, 75)) + draw.DrawText(blindlock_time_left_msg, "MyFont", 31, 26, Color(255, 255, 0, 255), TEXT_ALIGN_LEFT) + end + end +end +hook.Add("HUDPaint", "PH_HUDPaint", HUDPaint) + + +// Called immediately after starting the gamemode +function Initialize() + hullz = 80 + //surface.CreateFont("Arial", 14, 1200, true, false, "ph_arial") + surface.CreateFont( "MyFont", + { + font = "Arial", + size = 14, + weight = 1200, + antialias = true, + underline = false + }) +end +hook.Add("Initialize", "PH_Initialize", Initialize) + + +// Resets the player hull +function ResetHull(um) + if LocalPlayer() && LocalPlayer():IsValid() then + LocalPlayer():ResetHull() + hullz = 80 + end +end +usermessage.Hook("ResetHull", ResetHull) + +// Show hands! +function GM:PostDrawViewModel( vm, pl, weapon ) + if weapon.UseHands or (not weapon:IsScripted()) then + local hands = LocalPlayer():GetHands() + if IsValid(hands) then hands:DrawModel() end + end +end + +// Sets the local blind variable to be used in CalcView +function SetBlind(um) + blind = um:ReadBool() +end +usermessage.Hook("SetBlind", SetBlind) + + +// Sets the player hull +function SetHull(um) + hullxy = um:ReadLong() + hullz = um:ReadLong() + new_health = um:ReadLong() + + LocalPlayer():SetHull(Vector(hullxy * -1, hullxy * -1, 0), Vector(hullxy, hullxy, hullz)) + LocalPlayer():SetHullDuck(Vector(hullxy * -1, hullxy * -1, 0), Vector(hullxy, hullxy, hullz)) + LocalPlayer():SetHealth(new_health) +end +usermessage.Hook("SetHull", SetHull) diff --git a/gamemodes/prop_hunt/gamemode/cl_worldtips.lua b/gamemodes/prop_hunt/gamemode/cl_worldtips.lua index c4ed6e0..95b01d8 100644 --- a/gamemodes/prop_hunt/gamemode/cl_worldtips.lua +++ b/gamemodes/prop_hunt/gamemode/cl_worldtips.lua @@ -1,93 +1,93 @@ - - -surface.CreateFont( "GModWorldtip", -{ - font = "Helvetica", - size = 20, - weight = 700 -}) - -local cl_drawworldtooltips = CreateConVar( "cl_drawworldtooltips", "1", { FCVAR_ARCHIVE } ) -local WorldTip = nil - -local TipColor = Color( 250, 250, 200, 255 ) - --- --- Adds a hint to the queue --- -function AddWorldTip( unused1, text, unused2, pos, ent ) - - WorldTip = {} - - WorldTip.dietime = SysTime() + 0.05 - WorldTip.text = text - WorldTip.pos = pos - WorldTip.ent = ent - -end - - -local function DrawWorldTip( tip ) - - if ( IsValid( tip.ent ) ) then - tip.pos = tip.ent:GetPos() - end - - local pos = tip.pos:ToScreen() - - local black = Color( 0, 0, 0, 255 ) - local tipcol = Color( TipColor.r, TipColor.g, TipColor.b, 255 ) - - local x = 0 - local y = 0 - local padding = 10 - local offset = 50 - - surface.SetFont( "GModWorldtip" ) - local w, h = surface.GetTextSize( tip.text ) - - x = pos.x - w - y = pos.y - h - - x = x - offset - y = y - offset - - draw.RoundedBox( 8, x-padding-2, y-padding-2, w+padding*2+4, h+padding*2+4, black ) - - - local verts = {} - verts[1] = { x=x+w/1.5-2, y=y+h+2 } - verts[2] = { x=x+w+2, y=y+h/2-1 } - verts[3] = { x=pos.x-offset/2+2, y=pos.y-offset/2+2 } - - draw.NoTexture() - surface.SetDrawColor( 0, 0, 0, tipcol.a ) - surface.DrawPoly( verts ) - - - draw.RoundedBox( 8, x-padding, y-padding, w+padding*2, h+padding*2, tipcol ) - - local verts = {} - verts[1] = { x=x+w/1.5, y=y+h } - verts[2] = { x=x+w, y=y+h/2 } - verts[3] = { x=pos.x-offset/2, y=pos.y-offset/2 } - - draw.NoTexture() - surface.SetDrawColor( tipcol.r, tipcol.g, tipcol.b, tipcol.a ) - surface.DrawPoly( verts ) - - - draw.DrawText( tip.text, "GModWorldtip", x + w/2, y, black, TEXT_ALIGN_CENTER ) - -end - - -function GM:PaintWorldTips() - - if ( !cl_drawworldtooltips:GetBool() ) then return end - - if ( WorldTip && WorldTip.dietime > SysTime() ) then - DrawWorldTip( WorldTip ) - end - -end + + +surface.CreateFont( "GModWorldtip", +{ + font = "Helvetica", + size = 20, + weight = 700 +}) + +local cl_drawworldtooltips = CreateConVar( "cl_drawworldtooltips", "1", { FCVAR_ARCHIVE } ) +local WorldTip = nil + +local TipColor = Color( 250, 250, 200, 255 ) + +-- +-- Adds a hint to the queue +-- +function AddWorldTip( unused1, text, unused2, pos, ent ) + + WorldTip = {} + + WorldTip.dietime = SysTime() + 0.05 + WorldTip.text = text + WorldTip.pos = pos + WorldTip.ent = ent + +end + + +local function DrawWorldTip( tip ) + + if ( IsValid( tip.ent ) ) then + tip.pos = tip.ent:GetPos() + end + + local pos = tip.pos:ToScreen() + + local black = Color( 0, 0, 0, 255 ) + local tipcol = Color( TipColor.r, TipColor.g, TipColor.b, 255 ) + + local x = 0 + local y = 0 + local padding = 10 + local offset = 50 + + surface.SetFont( "GModWorldtip" ) + local w, h = surface.GetTextSize( tip.text ) + + x = pos.x - w + y = pos.y - h + + x = x - offset + y = y - offset + + draw.RoundedBox( 8, x-padding-2, y-padding-2, w+padding*2+4, h+padding*2+4, black ) + + + local verts = {} + verts[1] = { x=x+w/1.5-2, y=y+h+2 } + verts[2] = { x=x+w+2, y=y+h/2-1 } + verts[3] = { x=pos.x-offset/2+2, y=pos.y-offset/2+2 } + + draw.NoTexture() + surface.SetDrawColor( 0, 0, 0, tipcol.a ) + surface.DrawPoly( verts ) + + + draw.RoundedBox( 8, x-padding, y-padding, w+padding*2, h+padding*2, tipcol ) + + local verts = {} + verts[1] = { x=x+w/1.5, y=y+h } + verts[2] = { x=x+w, y=y+h/2 } + verts[3] = { x=pos.x-offset/2, y=pos.y-offset/2 } + + draw.NoTexture() + surface.SetDrawColor( tipcol.r, tipcol.g, tipcol.b, tipcol.a ) + surface.DrawPoly( verts ) + + + draw.DrawText( tip.text, "GModWorldtip", x + w/2, y, black, TEXT_ALIGN_CENTER ) + +end + + +function GM:PaintWorldTips() + + if ( !cl_drawworldtooltips:GetBool() ) then return end + + if ( WorldTip && WorldTip.dietime > SysTime() ) then + DrawWorldTip( WorldTip ) + end + +end diff --git a/gamemodes/prop_hunt/gamemode/init.lua b/gamemodes/prop_hunt/gamemode/init.lua index 48bb6ca..a44777c 100644 --- a/gamemodes/prop_hunt/gamemode/init.lua +++ b/gamemodes/prop_hunt/gamemode/init.lua @@ -1,21 +1,21 @@ -print(GetConVarNumber("HUNTER_KILL_BONUS")) - -// Send the required lua files to the client +-- Send the required lua files to the client AddCSLuaFile("cl_init.lua") AddCSLuaFile("sh_config.lua") AddCSLuaFile("sh_init.lua") AddCSLuaFile("sh_player.lua") -// If there is a mapfile send it to the client (sometimes servers want to change settings for certain maps) + +-- If there is a mapfile send it to the client (sometimes servers want to change settings for certain maps) if file.Exists("../gamemodes/prop_hunt/gamemode/maps/"..game.GetMap()..".lua", "LUA") then AddCSLuaFile("maps/"..game.GetMap()..".lua") end -// Include the required lua files +-- Include the required lua files include("sh_init.lua") -// Server only constants + +-- Server only constants EXPLOITABLE_DOORS = { "func_door", "prop_door_rotating", @@ -26,15 +26,12 @@ USABLE_PROP_ENTITIES = { "prop_physics_multiplayer" } -// Send the required resources to the client + +-- Send the required resources to the client for _, taunt in pairs(HUNTER_TAUNTS) do resource.AddFile("sound/"..taunt) end for _, taunt in pairs(PROP_TAUNTS) do resource.AddFile("sound/"..taunt) end -function GM:AllowPlayerPickup(player, entity) - return false -end - -// Called alot +-- Called alot function GM:CheckPlayerDeathRoundEnd() if !GAMEMODE.RoundBased || !GAMEMODE:InRound() then return @@ -49,17 +46,18 @@ function GM:CheckPlayerDeathRoundEnd() if table.Count(Teams) == 1 then local TeamID = table.GetFirstKey(Teams) - GAMEMODE:RoundEndWithResult(TeamID, team.GetName(TeamID).." win!") + GAMEMODE:RoundEndWithResult(TeamID, team.GetName(1).." win!") return end + end -// Called when an entity takes damage +-- Called when an entity takes damage function EntityTakeDamage(ent, dmginfo) local att = dmginfo:GetAttacker() if GAMEMODE:InRound() && ent && ent:GetClass() != "ph_prop" && !ent:IsPlayer() && att && att:IsPlayer() && att:Team() == TEAM_HUNTERS && att:Alive() then - att:SetHealth(att:Health() - GetConVar("HUNTER_FIRE_PENALTY"):GetInt()) + att:SetHealth(att:Health() - HUNTER_FIRE_PENALTY) if att:Health() <= 0 then MsgAll(att:Name() .. " felt guilty for hurting so many innocent props and committed suicide\n") att:Kill() @@ -69,7 +67,7 @@ end hook.Add("EntityTakeDamage", "PH_EntityTakeDamage", EntityTakeDamage) -// Called when player tries to pickup a weapon +-- Called when player tries to pickup a weapon function GM:PlayerCanPickupWeapon(pl, ent) if pl:Team() != TEAM_HUNTERS then return false @@ -78,21 +76,45 @@ function GM:PlayerCanPickupWeapon(pl, ent) return true end +-- Make a variable for custom 3 combines. +local playerModels = {} +local function addModel(model) + local t = {} + t.model = model + table.insert(playerModels, t) +end + +-- delivered from stock Gmod's player manager +addModel("combine") +addModel("combineprison") +addModel("combineelite") +addModel("police") -// Called when player needs a model function GM:PlayerSetModel(pl) + -- set antlion gib small for Prop model. Do not change into others because this might purposed as a hitbox. local player_model = "models/Gibs/Antlion_gib_small_3.mdl" + + -- set 3 combine models based cl_playermodel info. + local cl_playermodel = pl:GetInfo ( "cl_playermodel" ) - if pl:Team() == TEAM_HUNTERS then - player_model = "models/player/combine_super_soldier.mdl" - end + -- make it random selection + local customModel = table.Random(playerModels) + cl_playermodel = customModel.model + + -- translate it + local modelname = player_manager.TranslatePlayerModel( cl_playermodel ) + + -- for Hunter only + if pl:Team() == TEAM_HUNTERS then + player_model = modelname + end + -- Precache it util.PrecacheModel(player_model) pl:SetModel(player_model) end - - -// Called when a player tries to use an object + +-- Called when a player tries to use an object function GM:PlayerUse(pl, ent) if !pl:Alive() || pl:Team() == TEAM_SPECTATOR then return false end @@ -128,7 +150,7 @@ function GM:PlayerUse(pl, ent) end end - // Prevent the door exploit + -- Prevent the door exploit if table.HasValue(EXPLOITABLE_DOORS, ent:GetClass()) && pl.last_door_time && pl.last_door_time + 1 > CurTime() then return false end @@ -137,8 +159,7 @@ function GM:PlayerUse(pl, ent) return true end - -// Called when player presses [F3]. Plays a taunt for their team +-- Called when player presses [F3]. Plays a taunt for their team function GM:ShowSpare1(pl) if GAMEMODE:InRound() && pl:Alive() && (pl:Team() == TEAM_HUNTERS || pl:Team() == TEAM_PROPS) && pl.last_taunt_time + TAUNT_DELAY <= CurTime() && #PROP_TAUNTS > 1 && #HUNTER_TAUNTS > 1 then repeat @@ -156,23 +177,51 @@ function GM:ShowSpare1(pl) end end - -// Called when the gamemode is initialized +--[[ +-- Called when the gamemode is initialized -- This does not even working since the command is blocked. function Initialize() - game.ConsoleCommand("mp_flashlight 0\n") + game.ConsoleCommand("mp_flashlight 1\n") end hook.Add("Initialize", "PH_Initialize", Initialize) +]]-- - -// Called when a player leaves +-- Called when a player leaves function PlayerDisconnected(pl) pl:RemoveProp() end hook.Add("PlayerDisconnected", "PH_PlayerDisconnected", PlayerDisconnected) -// Called when the players spawns +-- Called when the players spawns function PlayerSpawn(pl) + + local oldhands = pl:GetHands() + if ( IsValid( oldhands ) ) then oldhands:Remove() end + + local hands = ents.Create( "gmod_hands" ) + if ( IsValid( hands ) ) then + pl:SetHands( hands ) + hands:SetOwner( pl ) + + -- Which hands should we use? + local cl_playermodel = pl:GetInfo( "cl_playermodel" ) + local info = player_manager.TranslatePlayerHands( cl_playermodel ) + if ( info ) then + hands:SetModel( info.model ) + hands:SetSkin( info.skin ) + hands:SetBodyGroups( info.body ) + end + + -- Attach them to the viewmodel + local vm = pl:GetViewModel( 0 ) + hands:AttachToViewmodel( vm ) + + vm:DeleteOnRemove( hands ) + pl:DeleteOnRemove( hands ) + + hands:Spawn() + end + pl:Blind(false) pl:RemoveProp() pl:SetColor( Color(255, 255, 255, 255)) @@ -189,7 +238,7 @@ end hook.Add("PlayerSpawn", "PH_PlayerSpawn", PlayerSpawn) -// Removes all weapons on a map +-- Removes all weapons on a map function RemoveWeaponsAndItems() for _, wep in pairs(ents.FindByClass("weapon_*")) do wep:Remove() @@ -202,7 +251,7 @@ end hook.Add("InitPostEntity", "PH_RemoveWeaponsAndItems", RemoveWeaponsAndItems) -// Called when round ends +-- Called when round ends function RoundEnd() for _, pl in pairs(team.GetPlayers(TEAM_HUNTERS)) do pl:Blind(false) @@ -212,7 +261,7 @@ end hook.Add("RoundEnd", "PH_RoundEnd", RoundEnd) -// This is called when the round time ends (props win) +-- This is called when the round time ends (props win) function GM:RoundTimerEnd() if !GAMEMODE:InRound() then return @@ -222,13 +271,13 @@ function GM:RoundTimerEnd() end -// Called before start of round +-- Called before start of round function GM:OnPreRoundStart(num) game.CleanUpMap() if GetGlobalInt("RoundNumber") != 1 && (SWAP_TEAMS_EVERY_ROUND == 1 || ((team.GetScore(TEAM_PROPS) + team.GetScore(TEAM_HUNTERS)) > 0 || SWAP_TEAMS_POINTS_ZERO==1)) then for _, pl in pairs(player.GetAll()) do - if pl:Team() == TEAM_PROPS || pl:Team() == TEAM_HUNTERS then + if pl:Team() == TEAM_PROPS || pl:Team() == TEAM_HUNTERS then if pl:Team() == TEAM_PROPS then pl:SetTeam(TEAM_HUNTERS) else @@ -236,6 +285,7 @@ function GM:OnPreRoundStart(num) end pl:ChatPrint("Teams have been swapped!") + end end end diff --git a/gamemodes/prop_hunt/gamemode/player_class/class_hunter.lua b/gamemodes/prop_hunt/gamemode/player_class/class_hunter.lua index 61f270f..105993a 100644 --- a/gamemodes/prop_hunt/gamemode/player_class/class_hunter.lua +++ b/gamemodes/prop_hunt/gamemode/player_class/class_hunter.lua @@ -1,73 +1,73 @@ -// Create new class -local CLASS = {} - - -// Some settings for the class -CLASS.DisplayName = "Hunter" -CLASS.WalkSpeed = 230 -CLASS.CrouchedWalkSpeed = 0.2 -CLASS.RunSpeed = 230 -CLASS.DuckSpeed = 0.2 -CLASS.DrawTeamRing = false - - -// Called by spawn and sets loadout -function CLASS:Loadout(pl) - pl:Give("weapon_crowbar") - pl:GiveAmmo(64, "Buckshot") - pl:GiveAmmo(255, "SMG1") - pl:Give("weapon_shotgun") - pl:Give("weapon_smg1") - - if GetConVar("WEAPONS_ALLOW_GRENADE"):GetBool() then - pl:Give("item_ar2_grenade") - end - - local cl_defaultweapon = pl:GetInfo("cl_defaultweapon") - - if pl:HasWeapon(cl_defaultweapon) then - pl:SelectWeapon(cl_defaultweapon) - end -end - - -// Called when player spawns with this class -function CLASS:OnSpawn(pl) - local unlock_time = math.Clamp(GetConVar("HUNTER_BLINDLOCK_TIME"):GetInt() - (CurTime() - GetGlobalFloat("RoundStartTime", 0)), 0, GetConVar("HUNTER_BLINDLOCK_TIME"):GetInt()) - - //function MyLockFunc() - //function MyUnlockFunc() - - local unblindfunc = function() - //MyUnblindFunc(pl.Blind(false)) - pl:Blind(false) - end - local lockfunc = function() - //MyLockFunc(pl.Lock()) - pl.Lock(pl) - end - local unlockfunc = function() - //MyUnlockFunc(pl.UnLock()) - pl.UnLock(pl) - end - - if unlock_time > 2 then - pl:Blind(true) - - timer.Simple(unlock_time, unblindfunc) - - timer.Simple(2, lockfunc) - timer.Simple(unlock_time, unlockfunc) - end -end - - -// Called when a player dies with this class -function CLASS:OnDeath(pl, attacker, dmginfo) - pl:CreateRagdoll() - pl:UnLock() -end - - -// Register +// Create new class +local CLASS = {} + + +// Some settings for the class +CLASS.DisplayName = "Hunter" +CLASS.WalkSpeed = 230 +CLASS.CrouchedWalkSpeed = 0.2 +CLASS.RunSpeed = 250 +CLASS.DuckSpeed = 0.2 +CLASS.DrawTeamRing = false + + +// Called by spawn and sets loadout +function CLASS:Loadout(pl) + pl:GiveAmmo(64, "Buckshot") + pl:GiveAmmo(255, "SMG1") + pl:GiveAmmo(12, "357") + + pl:Give("weapon_crowbar") + pl:Give("weapon_shotgun") + pl:Give("weapon_smg1") + pl:Give("item_ar2_grenade") + pl:Give("weapon_357") + + local cl_defaultweapon = pl:GetInfo("cl_defaultweapon") + + if pl:HasWeapon(cl_defaultweapon) then + pl:SelectWeapon(cl_defaultweapon) + end +end + + +// Called when player spawns with this class +function CLASS:OnSpawn(pl) + local unlock_time = math.Clamp(HUNTER_BLINDLOCK_TIME - (CurTime() - GetGlobalFloat("RoundStartTime", 0)), 0, HUNTER_BLINDLOCK_TIME) + + //function MyLockFunc() + //function MyUnlockFunc() + + local unblindfunc = function() + //MyUnblindFunc(pl.Blind(false)) + pl:Blind(false) + end + local lockfunc = function() + //MyLockFunc(pl.Lock()) + pl.Lock(pl) + end + local unlockfunc = function() + //MyUnlockFunc(pl.UnLock()) + pl.UnLock(pl) + end + + if unlock_time > 2 then + pl:Blind(true) + + timer.Simple(unlock_time, unblindfunc) + + timer.Simple(2, lockfunc) + timer.Simple(unlock_time, unlockfunc) + end +end + + +// Called when a player dies with this class +function CLASS:OnDeath(pl, attacker, dmginfo) + pl:CreateRagdoll() + pl:UnLock() +end + + +// Register player_class.Register("Hunter", CLASS) \ No newline at end of file diff --git a/gamemodes/prop_hunt/gamemode/player_class/class_prop.lua b/gamemodes/prop_hunt/gamemode/player_class/class_prop.lua index a8bc5bc..d663184 100644 --- a/gamemodes/prop_hunt/gamemode/player_class/class_prop.lua +++ b/gamemodes/prop_hunt/gamemode/player_class/class_prop.lua @@ -1,43 +1,43 @@ -// Create new class -local CLASS = {} - - -// Some settings for the class -CLASS.DisplayName = "Prop" -CLASS.WalkSpeed = 250 -CLASS.CrouchedWalkSpeed = 0.2 -CLASS.RunSpeed = 250 -CLASS.DuckSpeed = 0.2 -CLASS.DrawTeamRing = false - - -// Called by spawn and sets loadout -function CLASS:Loadout(pl) - // Props don't get anything -end - - -// Called when player spawns with this class -function CLASS:OnSpawn(pl) - pl:SetColor( Color(255, 255, 255, 0)) - - pl.ph_prop = ents.Create("ph_prop") - pl.ph_prop:SetPos(pl:GetPos()) - pl.ph_prop:SetAngles(pl:GetAngles()) - pl.ph_prop:Spawn() - pl.ph_prop:SetSolid(SOLID_BBOX) - pl.ph_prop:SetParent(pl) - pl.ph_prop:SetOwner(pl) - - pl.ph_prop.max_health = 100 -end - - -// Called when a player dies with this class -function CLASS:OnDeath(pl, attacker, dmginfo) - pl:RemoveProp() -end - - -// Register +// Create new class +local CLASS = {} + + +// Some settings for the class +CLASS.DisplayName = "Prop" +CLASS.WalkSpeed = 250 +CLASS.CrouchedWalkSpeed = 0.2 +CLASS.RunSpeed = 270 +CLASS.DuckSpeed = 0.2 +CLASS.DrawTeamRing = false + + +// Called by spawn and sets loadout +function CLASS:Loadout(pl) + // Props don't get anything +end + + +// Called when player spawns with this class +function CLASS:OnSpawn(pl) + pl:SetColor( Color(255, 255, 255, 0)) + + pl.ph_prop = ents.Create("ph_prop") + pl.ph_prop:SetPos(pl:GetPos()) + pl.ph_prop:SetAngles(pl:GetAngles()) + pl.ph_prop:Spawn() + pl.ph_prop:SetSolid(SOLID_BBOX) + pl.ph_prop:SetParent(pl) + pl.ph_prop:SetOwner(pl) + + pl.ph_prop.max_health = 100 +end + + +// Called when a player dies with this class +function CLASS:OnDeath(pl, attacker, dmginfo) + pl:RemoveProp() +end + + +// Register player_class.Register("Prop", CLASS) \ No newline at end of file diff --git a/gamemodes/prop_hunt/gamemode/sh_config.lua b/gamemodes/prop_hunt/gamemode/sh_config.lua index a658f53..fa8d6fa 100644 --- a/gamemodes/prop_hunt/gamemode/sh_config.lua +++ b/gamemodes/prop_hunt/gamemode/sh_config.lua @@ -1,51 +1,78 @@ -// Props will not be able to become these models +-- Props will not be able to become these models BANNED_PROP_MODELS = { "models/props/cs_assault/dollar.mdl", "models/props/cs_assault/money.mdl", - "models/props/cs_office/snowman_arm.mdl" + "models/props/cs_office/snowman_arm.mdl", + "models/props/cs_office/computer_mouse.mdl", + "models/props/cs_office/projector_remote.mdl", + "models/props/cs_militia/reload_bullet_tray.mdl", + "models/foodnhouseholditems/egg.mdl" } -// Maximum time (in minutes) for this fretta gamemode (Default: 30) +-- Maximum time (in minutes) for this fretta gamemode (Default: 30) GAME_TIME = 30 -// Number of seconds hunters are blinded/locked at the beginning of the map (Default: 30) -CreateConVar("HUNTER_BLINDLOCK_TIME", "30", FCVAR_REPLICATED) -//Create the convars here -// Health points removed from hunters when they shoot (Default: 5) -CreateConVar( "HUNTER_FIRE_PENALTY", "5", FCVAR_REPLICATED) +-- Number of seconds hunters are blinded/locked at the beginning of the map (Default: 30) +HUNTER_BLINDLOCK_TIME = 30 -// How much health to give back to the Hunter after killing a prop (Default: 20) -CreateConVar( "HUNTER_KILL_BONUS", "20", FCVAR_REPLICATED) -//Whether or not we include grenade launcher ammo (default: 1) -CreateConVar( "WEAPONS_ALLOW_GRENADE", "1", FCVAR_REPLICATED) +-- Health points removed from hunters when they shoot (Default: 25) +HUNTER_FIRE_PENALTY = 5 -// If you loose one of these will be played -// Set blank to disable + +-- How much health to give back to the Hunter after killing a prop (Default: 100) +HUNTER_KILL_BONUS = 100 + + +-- If you loose one of these will be played +-- Set blank to disable + +-- // DEV HELP: why this is not working anymore? \\ -- LOSS_SOUNDS = { "vo/announcer_failure.wav", "vo/announcer_you_failed.wav" } - -// Sound files hunters can taunt with -// You need at least 2 files listed here +-- Sound files hunters can taunt with +-- You need at least 2 files listed here HUNTER_TAUNTS = { - "taunts/you_dont_know_the_power.wav", - "taunts/you_underestimate_the_power.wav" + + -- Normal Taunts + "taunts/hunters/come_to_papa.wav", + "taunts/hunters/father.mp3", + "taunts/hunters/fireassis.wav", + "taunts/hunters/hitassist.wav", + "taunts/hunters/now_what.wav", + "taunts/hunters/you_dont_know_the_power.wav", + "taunts/hunters/you_underestimate_the_power.wav", + "taunts/hunters/glados-president.wav", + "taunts/hunters/rude.mp3", + "taunts/hunters/soul.mp3", + "taunts/hunters/illfindyou.mp3", + + -- Half-Life 2 + "vo/k_lab/ba_guh.wav", + + -- Male + "vo/npc/male01/vanswer13.wav", + "vo/npc/male01/thehacks01.wav", + "vo/npc/male01/runforyourlife02.wav", + "vo/npc/male01/overhere01.wav", + "vo/npc/male01/overthere01.wav", + "vo/npc/male01/overthere02.wav" } -// Sound files props can taunt with -// You need at least 2 files listed here +-- Sound files props can taunt with +-- You need at least 2 files listed here PROP_TAUNTS = { "taunts/boom_headshot.wav", - "taunts/doh.wav", "taunts/go_away_or_i_shall.wav", "taunts/ill_be_back.wav", "taunts/negative.wav", + "taunts/doh.wav", "taunts/oh_yea_he_will_pay.wav", "taunts/ok_i_will_tell_you.wav", "taunts/please_come_again.wav", @@ -64,7 +91,6 @@ PROP_TAUNTS = { "taunts/props/10.wav", "taunts/props/11.wav", "taunts/props/12.wav", - "taunts/props/13.mp3", "taunts/props/14.wav", "taunts/props/15.wav", "taunts/props/16.wav", @@ -87,29 +113,81 @@ PROP_TAUNTS = { "taunts/props/33.mp3", "taunts/props/34.mp3", "taunts/props/35.mp3", - --"taunts/you_dont_know_the_power.wav", - --"taunts/you_underestimate_the_power.wav" + + -- // Half-life 2 taunts \\ -- + + -- Citadel part + "vo/citadel/br_ohshit.wav", + "vo/citadel/br_youfool.wav", + "vo/citadel/br_youneedme.wav", + + -- Coast part + "vo/coast/odessa/male01/nlo_cheer01.wav", + "vo/coast/odessa/male01/nlo_cheer02.wav", + "vo/coast/odessa/male01/nlo_cheer03.wav", + "vo/coast/odessa/male01/nlo_cheer04.wav", + "vo/coast/odessa/female01/nlo_cheer01.wav", + "vo/coast/odessa/female01/nlo_cheer02.wav", + "vo/coast/odessa/female01/nlo_cheer03.wav", + + -- Gman + "vo/gman_misc/gman_riseshine.wav", + + -- // General NPC Quotes \\ -- + + -- Barney + "vo/npc/barney/ba_damnit.wav", + "vo/npc/barney/ba_laugh01.wav", + "vo/npc/barney/ba_laugh02.wav", + "vo/npc/barney/ba_laugh03.wav", + "vo/npc/barney/ba_laugh04.wav", + + -- Male Citizen + "vo/npc/male01/hacks01.wav", + "vo/npc/male01/hacks02.wav", + "vo/npc/male01/vanswer01.wav", + "vo/npc/male01/question05.wav", + "vo/npc/male01/question06.wav", + "vo/npc/male01/answer34.wav", + "vo/npc/male01/question30.wav", + "vo/npc/male01/question26.wav", + "vo/npc/male01/incoming02.wav", + "vo/npc/male01/gethellout.wav", + + -- Father Grigori + "vo/ravenholm/madlaugh04.wav", + + -- Fixed taunts + "taunts/fixed/13_fix.wav", + "taunts/fixed/bees_fix.wav", + + -- Additionals == + + -- Moved from Hunter to Props (this supposed to be props...) + "taunts/hunters/laugh.wav" } -// Seconds a player has to wait before they can taunt again (Default: 5) -TAUNT_DELAY = 3 +-- Seconds a player has to wait before they can taunt again (Default: 2 or 3) +TAUNT_DELAY = 2 -// Rounds played on a map (Default: 10) +-- Rounds played on a map (Default: 10) ROUNDS_PER_MAP = 10 -// Time (in seconds) for each round (Default: 300) +-- Time (in seconds) for each round (Default: 300) ROUND_TIME = 300 -// Determains if players should be team swapped every round [0 = No, 1 = Yes] (Default: 1) +-- Determains if players should be team swapped every round [0 = No, 1 = Yes] (Default: 1) SWAP_TEAMS_EVERY_ROUND = 1 -// If you win, one of these will be played -// Set blank to disable +-- If you win, one of these will be played +-- Set blank to disable + +-- // DEV HELP: why this is not working anymore? \\ -- VICTORY_SOUNDS = { "vo/announcer_success.wav", "vo/announcer_victory.wav", diff --git a/gamemodes/prop_hunt/gamemode/sh_init.lua b/gamemodes/prop_hunt/gamemode/sh_init.lua index c147e73..af72969 100644 --- a/gamemodes/prop_hunt/gamemode/sh_init.lua +++ b/gamemodes/prop_hunt/gamemode/sh_init.lua @@ -1,67 +1,66 @@ -// Include the required lua files -include("sh_config.lua") -include("sh_player.lua") - - -// Include the configuration for this map -if file.Exists("../gamemodes/prop_hunt/gamemode/maps/"..game.GetMap()..".lua", "LUA") || file.Exists("../lua_temp/prop_hunt/gamemode/maps/"..game.GetMap()..".lua", "LUA") then - include("maps/"..game.GetMap()..".lua") -end - - -// Fretta! -DeriveGamemode("fretta") -IncludePlayerClasses() - - -// Information about the gamemode -GM.Name = "Prop Hunt" -GM.Author = "Kow@lski (Original by AMT)" -GM.Email = "kowalski.7cc@xspacesoft.com" -GM.Website = "http://xspacesoft.github.io/PropHunt/" - - -// Help info -GM.Help = [[Prop Hunt is a twist on the classic backyard game Hide and Seek. - -As a Prop you have ]]..GetConVar("HUNTER_BLINDLOCK_TIME"):GetInt()..[[ seconds to replicate an existing prop on the map and then find a good hiding spot. Press [E] to replicate the prop you are looking at. Your health is scaled based on the size of the prop you replicate. - -As a Hunter you will be blindfolded for the first ]]..GetConVar("HUNTER_BLINDLOCK_TIME"):GetInt()..[[ seconds of the round while the Props hide. When your blindfold is taken off, you will need to find props controlled by players and kill them. Damaging non-player props will lower your health significantly. However, killing a Prop will increase your health by ]]..GetConVar("HUNTER_KILL_BONUS"):GetInt()..[[ points. - -Both teams can press [F3] to play a taunt sound.]] - - -// Fretta configuration -GM.AddFragsToTeamScore = true -GM.CanOnlySpectateOwnTeam = true -GM.Data = {} -GM.EnableFreezeCam = true -GM.GameLength = GAME_TIME -GM.NoAutomaticSpawning = true -GM.NoNonPlayerPlayerDamage = true -GM.NoPlayerPlayerDamage = true -GM.RoundBased = true -GM.RoundLimit = ROUNDS_PER_MAP -GM.RoundLength = ROUND_TIME -GM.RoundPreStartTime = 0 -GM.SelectModel = false -GM.SuicideString = "couldn't take the pressure and committed suicide." -GM.TeamBased = true - - -// Called on gamemdoe initialization to create teams -function GM:CreateTeams() - if !GAMEMODE.TeamBased then - return - end - - TEAM_HUNTERS = 1 - team.SetUp(TEAM_HUNTERS, "Hunters", Color(150, 205, 255, 255)) - team.SetSpawnPoint(TEAM_HUNTERS, {"info_player_counterterrorist", "info_player_combine", "info_player_deathmatch", "info_player_axis"}) - team.SetClass(TEAM_HUNTERS, {"Hunter"}) - - TEAM_PROPS = 2 - team.SetUp(TEAM_PROPS, "Props", Color(255, 60, 60, 255)) - team.SetSpawnPoint(TEAM_PROPS, {"info_player_terrorist", "info_player_rebel", "info_player_deathmatch", "info_player_allies"}) - team.SetClass(TEAM_PROPS, {"Prop"}) -end \ No newline at end of file +-- Include the required lua files +include("sh_config.lua") +include("sh_player.lua") + + +-- Include the configuration for this map +if file.Exists("../gamemodes/prop_hunt/gamemode/maps/"..game.GetMap()..".lua", "LUA") || file.Exists("../lua_temp/prop_hunt/gamemode/maps/"..game.GetMap()..".lua", "LUA") then + include("maps/"..game.GetMap()..".lua") +end + + +-- Fretta! +DeriveGamemode("fretta") +IncludePlayerClasses() + + +-- Information about the gamemode +GM.Name = "Prop Hunt" +GM.Author = "Wolvindra-Vinzuerio (fixed, original by Kowalski/AMT)" + + +-- Help info +GM.Help = [[Prop Hunt is a twist on the classic backyard game Hide and Seek. + +As a Prop you have ]]..HUNTER_BLINDLOCK_TIME..[[ seconds to replicate an existing prop on the map and then find a good hiding spot. Press [E] to replicate the prop you are looking at. Your health is scaled based on the size of the prop you replicate. + +As a Hunter you will be blindfolded for the first ]]..HUNTER_BLINDLOCK_TIME..[[ seconds of the round while the Props hide. When your blindfold is taken off, you will need to find props controlled by players and kill them. Damaging non-player props will lower your health significantly. However, killing a Prop will increase your health by ]]..HUNTER_KILL_BONUS..[[ points. + +Both teams can press [F3] to play a taunt sound.]] + + +-- Fretta configuration +GM.AddFragsToTeamScore = true +GM.CanOnlySpectateOwnTeam = true +GM.ValidSpectatorModes = { OBS_MODE_CHASE, OBS_MODE_IN_EYE, OBS_MODE_ROAMING } +GM.Data = {} +GM.EnableFreezeCam = true +GM.GameLength = GAME_TIME +GM.NoAutomaticSpawning = true +GM.NoNonPlayerPlayerDamage = true +GM.NoPlayerPlayerDamage = true +GM.RoundBased = true +GM.RoundLimit = ROUNDS_PER_MAP +GM.RoundLength = ROUND_TIME +GM.RoundPreStartTime = 0 +GM.SelectModel = false +GM.SuicideString = "suicided or died mysteriously." +GM.TeamBased = true + + +-- Called on gamemdoe initialization to create teams +function GM:CreateTeams() + if !GAMEMODE.TeamBased then + return + end + + TEAM_HUNTERS = 1 + team.SetUp(TEAM_HUNTERS, "Hunters", Color(150, 205, 255, 255)) + team.SetSpawnPoint(TEAM_HUNTERS, {"info_player_counterterrorist", "info_player_combine", "info_player_deathmatch", "info_player_axis"}) + team.SetClass(TEAM_HUNTERS, {"Hunter"}) + + TEAM_PROPS = 2 + team.SetUp(TEAM_PROPS, "Props", Color(255, 60, 60, 255)) + team.SetSpawnPoint(TEAM_PROPS, {"info_player_terrorist", "info_player_rebel", "info_player_deathmatch", "info_player_allies"}) + team.SetClass(TEAM_PROPS, {"Prop"}) +end diff --git a/gamemodes/prop_hunt/gamemode/sh_player.lua b/gamemodes/prop_hunt/gamemode/sh_player.lua index b96ada0..458c19a 100644 --- a/gamemodes/prop_hunt/gamemode/sh_player.lua +++ b/gamemodes/prop_hunt/gamemode/sh_player.lua @@ -1,32 +1,32 @@ -// Finds the player meta table or terminates -local meta = FindMetaTable("Player") -if !meta then return end - - -// Blinds the player by setting view out into the void -function meta:Blind(bool) - if !self:IsValid() then return end - - if SERVER then - umsg.Start("SetBlind", self) - if bool then - umsg.Bool(true) - else - umsg.Bool(false) - end - umsg.End() - elseif CLIENT then - blind = bool - end -end - - -// Blinds the player by setting view out into the void -function meta:RemoveProp() - if CLIENT || !self:IsValid() then return end - - if self.ph_prop && self.ph_prop:IsValid() then - self.ph_prop:Remove() - self.ph_prop = nil - end +// Finds the player meta table or terminates +local meta = FindMetaTable("Player") +if !meta then return end + + +// Blinds the player by setting view out into the void +function meta:Blind(bool) + if !self:IsValid() then return end + + if SERVER then + umsg.Start("SetBlind", self) + if bool then + umsg.Bool(true) + else + umsg.Bool(false) + end + umsg.End() + elseif CLIENT then + blind = bool + end +end + + +// Blinds the player by setting view out into the void +function meta:RemoveProp() + if CLIENT || !self:IsValid() then return end + + if self.ph_prop && self.ph_prop:IsValid() then + self.ph_prop:Remove() + self.ph_prop = nil + end end \ No newline at end of file diff --git a/gamemodes/prop_hunt/icon24.png b/gamemodes/prop_hunt/icon24.png index 35d8f4c..01de2c3 100644 Binary files a/gamemodes/prop_hunt/icon24.png and b/gamemodes/prop_hunt/icon24.png differ diff --git a/gamemodes/prop_hunt/logo.png b/gamemodes/prop_hunt/logo.png index 05b0146..ccced95 100644 Binary files a/gamemodes/prop_hunt/logo.png and b/gamemodes/prop_hunt/logo.png differ diff --git a/gamemodes/prop_hunt/prop_hunt.txt b/gamemodes/prop_hunt/prop_hunt.txt index 24e9cd2..67ccca4 100644 --- a/gamemodes/prop_hunt/prop_hunt.txt +++ b/gamemodes/prop_hunt/prop_hunt.txt @@ -2,23 +2,51 @@ { "base" "base" "title" "Prop Hunt" - "maps" "^cs_|^de_|^ph_" + "maps" "^ph_" "fretta_maps" { - "1" "cs_" - "2" "de_" - "3" "ph_" + "1" "cs_" + "2" "de_" + "3" "ph_" } "selectable" "1" "menusystem" "1" - "workshopid" "135509255" - + "workshopid" "417565863" "settings" { - //For some reason these values do not create / update convars within the game. - //You must manually set them via the console in order for them to change (similar to games like TTT) + 1 + { + "name" "HUNTER_FIRE_PENALTY" + "text" "Hunter Fire Penality" + "help" "Health points removed from hunters when they shoot" + "type" "numeric" + "default" "5" + } + + + + 2 + { + "name" "HUNTER_KILL_BONUS" + "text" "Hunter Kill Bonus" + "help" "How much health to give back to the Hunter after killing a prop" + "type" "numeric" + "default" "100" + } + + + + 3 + { + "name" "SWAP_TEAMS_EVERY_ROUND" + "text" "Swap Teams Every Round" + "help" "Determains if players should be team swapped every round" + "type" "checkbox" + "default" "1" + } + } }