Skip to content

Commit

Permalink
Revision 27/08/2022
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzuerio committed Aug 27, 2022
1 parent 776e57d commit ffad2dd
Show file tree
Hide file tree
Showing 27 changed files with 1,809 additions and 62 deletions.
12 changes: 12 additions & 0 deletions CHANGES.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
## A new major updates to Prop Hunt: X has been released.
For now, the Prop Hunt X will change it's version to "X2Z" following with date-formatted revisions.

## Revision 27.08.2022
- Fixed Team Rotation related bug that being unable to join. You need to disable `ph_force_join_balanced_teams` to `0` to join to any Suffled Team/Rotation mode otherwise you won't be able to join to any team.
- Changed `ph_forcejoinbalancedteam` to `ph_force_join_balanced_teams` ConVar to reset this behaviour.
- Added Callbacks to `ph_originalteambalance` to disable `ph_force_join_balanced_teams` when Team Shuffle/Rotation mode is enabled. You have to Re-enable this once the Team Shuffle/Rotation is Turned-off.
- Fixed Enhanced Plus Panels doesn't update immediately after a ConVar changes
- Fixed "LocalPlayer()" becoming NULL when trying to get a "Game Control" notification upon Joining
- Fixed Taunt Menu being disabled after being respawned from Hunter Blind phase
- Removed Debug Message in Serverside LPS Code
- Fixed Map Config file for `ph_kliener_v2` to use a default color instead (No Player color will be allowed if 'kleiner' model is present).
- Added `Entity:SetEntColorEnabled( boolean )`, `Entity:GetEntColorEnabled()` for Prop Entity to force enable or disable of Player Colour function.
- Updated "Indonesian" Translation and updated Language Untranslated Text to prevent Errors text from displaying

## Revision 25.08.2022
- **Fixed where some PH:X Admin-only Console Commands can be *still* accessed without Admin Checks (e.g. OBB Reload, Taunt Reload, etc). This issue existed since PH:E v15~v16 and PH:X before August Update.** However, this issues has been fixed **on August Revision Update (25.08.2022)**.
- `GM:ShowTeam()` and `GM:ShowSplash()` are now moved to Prop Hunt Gamemode Base (Originally from Fretta's base).
Expand Down
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## X2Z - Road to Zero

### Versioning
Version: X2Z, Revision: 25/08/2022 (dd/mm/yyyy)
Version: X2Z, Revision: 27/08/2022 (dd/mm/yyyy)

### Public Servers
- Server #1 [U.S]: **74.91.120.8:27015**
Expand Down
35 changes: 24 additions & 11 deletions gamemodes/prop_hunt/entities/entities/ph_prop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ ENT.Spawnable = true
ENT.AdminOnly = false
ENT.RenderGroup = RENDERGROUP_BOTH

ENT.PropAngle = angle_zero
ENT.PropPosition = vector_origin
ENT.DefaultColor = Vector(1,1,1)
ENT.PropAngle = angle_zero
ENT.PropPosition = vector_origin
ENT.DefaultColor = Vector(1,1,1)
ENT.FallBackColor = Vector( 62 / 255, 88 / 255, 106 / 255 ) --lua/matproxy/player_color.lua

function ENT:SetupDataTables()
self:NetworkVar( "Angle", 0, "RotationAngle" )
self:NetworkVar( "Vector", 0, "EntityColor")
self:NetworkVar( "Vector", 0, "EntityColor" )
self:NetworkVar( "Bool", 0, "EntColorEnabled" )

if SERVER then
self:SetEntityColor( self.DefaultColor )
Expand All @@ -30,8 +32,9 @@ end
function ENT:Initialize()
if SERVER then
self:SetModel("models/player/kleiner.mdl")
self:SetLagCompensated(true)
self:SetLagCompensated(true)
self:SetMoveType(MOVETYPE_NONE)
self:SetEntColorEnabled( true )

self.health = 100
end
Expand All @@ -46,12 +49,22 @@ if CLIENT then
end

ENT.GetPlayerColor = function( self )
local state = GetGlobalBool( "ph_enable_prop_player_color" , false )
if state then
return self:GetEntityColor()
else
return self.DefaultColor
end

if self:GetEntColorEnabled() then

local state = GetGlobalBool( "ph_enable_prop_player_color" , false )
if state then
return self:GetEntityColor()
else
return self.DefaultColor
end

else

return self.FallBackColor

end

end

function ENT:CalcRotation( ply, pos, ang, bLock )
Expand Down
13 changes: 8 additions & 5 deletions gamemodes/prop_hunt/gamemode/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,12 @@ function GM:ShowTeam()
local btn = TeamPanel:AddSelectButton( strName, func )
btn.m_colBackground = TeamInfo.Color
btn.Think = function( self )
self:SetText( Format( "%s (%i)", strName, team.NumPlayers( ID ) ))
if ID ~= TEAM_SPECTATOR then -- skip player ammount check
self:SetDisabled( GAMEMODE:TeamHasEnoughPlayers( ID ) )
end
end
self:SetText( Format( "%s (%i)", strName, team.NumPlayers( ID ) ))
--[[ if ID ~= TEAM_SPECTATOR then
self:SetDisabled( GAMEMODE:TeamHasEnoughPlayers( ID ) )
end ]]
self:SetDisabled(GAMEMODE:CustomTeamHasEnoughPlayers(ID, LocalPlayer()))
end

if ( IsValid( LocalPlayer() ) && LocalPlayer():Team() == ID ) then
btn:SetDisabled( true )
Expand Down Expand Up @@ -654,6 +655,8 @@ end)

function PHX:ShowTutorPopup()

if (not IsValid(LocalPlayer())) then return end

if self:GetCLCVar( "ph_show_tutor_control" ) && LocalPlayer():Alive() && (LocalPlayer():Team() == TEAM_PROPS or LocalPlayer():Team() == TEAM_HUNTERS) then

if curshow <= 4 then
Expand Down
2 changes: 1 addition & 1 deletion gamemodes/prop_hunt/gamemode/cl_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ function PHX.UI.BaseMainMenu(ply, cmd, args)

PHX.UI:CreateVGUIType("", "label", "PHX.MenuCategoryLabel", grid, "PHXM_ADMIN_TEAMBALANCE")
PHX.UI:CreateVGUIType("ph_enable_teambalance", "check", "SERVER", grid, "PHXM_ADMIN_ENABLETEAMBALANCE")
PHX.UI:CreateVGUIType("ph_forcejoinbalancedteams", "check", "SERVER", grid, "PHXM_ADMIN_FORCEJOINBALANCE")
PHX.UI:CreateVGUIType("ph_force_join_balanced_teams", "check", "SERVER", grid, "PHXM_ADMIN_FORCEJOINBALANCE")
PHX.UI:CreateVGUIType("ph_max_teamchange_limit", "slider", {min = 3, max = 50, init = PHX:GetCVar( "ph_max_teamchange_limit" ), dec = 0, kind = "SERVER"}, grid, "PHXM_ADMIN_CHANGETEAM_LIMIT")
PHX.UI:CreateVGUIType("ph_allow_respawnonblind_teamchange", "check", "SERVER", grid, "PHXM_ADMIN_ALLOWRESPAWN_TEAMCHANGE")

Expand Down
2 changes: 2 additions & 0 deletions gamemodes/prop_hunt/gamemode/cl_tauntwindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ window.state = false
window.CurrentlyOpen = false

net.Receive("PH_ForceCloseTauntWindow", function()
-- Reset Category upon team change or death
LocalPlayer():SetVar("tauntWindowCategorie", PHX.DEFAULT_CATEGORY)
if window.CurrentlyOpen then
window.frame:Close()
end
Expand Down
7 changes: 2 additions & 5 deletions gamemodes/prop_hunt/gamemode/config/maps/ph_hotel.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- ph_hotel Configuration.
-- if you found this exploitable by Players, Adjust the Prop's bounding box to your appropriate setting.
PHX.VerboseMsg("[PHX Map Config] Loaded.")
PHX.VerboseMsg("[PHX Map Config] Config for 'ph_hotel' has been loaded.")

local mdls = {
"models/props_debris/wood_board05a.mdl",
Expand Down Expand Up @@ -39,7 +39,4 @@ local function FixTallModelHulls()
end
end

local function PHX_phhotel_conf()
FixTallModelHulls()
end
hook.Add("PostCleanupMap", "PHX.ph_hotel.config", PHX_phhotel_conf)
hook.Add("PostCleanupMap", "PHX.ph_hotel.config", FixTallModelHulls)
42 changes: 29 additions & 13 deletions gamemodes/prop_hunt/gamemode/config/maps/ph_kliener_v2.lua
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
-- ph_kleiner Configuration.
-- Add some Invisible Wall to prevent Exploit. Additionaly, Force all player props become Kleiner model after 0.5 seconds of respawn.
PHX.VerboseMsg("[PHX Map Config] Loaded.")
PHX.VerboseMsg("[PHX Map Config] Config for 'ph_kliener_v2' has been loaded.")

local function RemoveClipBrush()
for _,pc in pairs(ents.FindByClass("brush_playerclip")) do
if !IsValid(pc) then return end
PHX.VerboseMsg("[PH_Kleiner_v2.Config] Removing Anti Exploit Brush -> #"..pc:EntIndex())
PHX.VerboseMsg("[PH:X ph_kliener_v2] Removing Anti Exploit Brush -> #"..pc:EntIndex())
pc:Remove()
end
end
hook.Add("PreCleanupMap", "PH_RemoveClip", RemoveClipBrush)
hook.Add("PreCleanupMap", "PHX.ph_kliener_v2.RemoveClip", RemoveClipBrush)

local Clips = {
{ mins = Vector(1040, -273, 1000), maxs = Vector(-1159, -156, 1500) },
{ mins = Vector(-1020, 639, -50), maxs = Vector(-1306, 669, 850) },
{ mins = Vector(-1299, 659, -50), maxs = Vector(-1312, -1440, 1510) },
{ mins = Vector(-1302, -1434, -371), maxs = Vector(1042, -3500, 1500) },
{ mins = Vector(1049, -1432, -50), maxs = Vector(1058, -217, 1400) }
}

local function PostCreatePlayerClip()
PHX.VerboseMsg("Creating Anti Exploit walls...")
PHX:CreatePlayerClip(Vector(1040, -273, 1000), Vector(-1159, -156, 1500))
PHX:CreatePlayerClip(Vector(-1020, 639, -50), Vector(-1306, 669, 850))
PHX:CreatePlayerClip(Vector(-1299, 659, -50), Vector(-1312, -1440, 1510))
PHX:CreatePlayerClip(Vector(-1302, -1434, -371), Vector(1042, -3500, 1500))
PHX:CreatePlayerClip(Vector(1049, -1432, -50), Vector(1058, -217, 1400))

PHX.VerboseMsg("[PH:X ph_kliener_v2] Creating Anti Exploit walls...")

for _,bounds in pairs(Clips) do
PHX:CreatePlayerClip(bounds.mins, bounds.maxs)
end

-- Disable all shadows
local ShadowControl = ents.Create( "shadow_control" )
ShadowControl:SetPos( Vector( 0, 0, 0 ) )
Expand All @@ -27,11 +34,20 @@ local function PostCreatePlayerClip()
ShadowControl:Activate()

-- Force all players become Kleiner on respawn!
timer.Simple(5, function()
timer.Simple(2, function()
for k,v in pairs(ents.FindByClass("ph_prop")) do
v:SetModel("models/player/kleiner.mdl")
v:DrawShadow(false)
v:DrawShadow( false )
v:SetEntColorEnabled( false )
end
end)
end
hook.Add("PostCleanupMap", "PH_AddClipBrush", PostCreatePlayerClip)
hook.Add("PostCleanupMap", "PHX.ph_kliener_v2.config", PostCreatePlayerClip)

hook.Add("PlayerSpawn", "PHX.ph_kliener_v2.IsKleiner", function( ply )
timer.Simple(0, function()
if IsValid(ply) and ply:GetModel() == "models/player/kleiner.mdl" then
ply:SetPlayerColor(Vector( 0.24, 0.34, 0.41 ))
end
end)
end)
9 changes: 6 additions & 3 deletions gamemodes/prop_hunt/gamemode/enhancedplus/cl_enhancedplus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,14 @@ function plus:CreatePanel( tab )
self.chkOrigTeamBal:DockMargin(8,4,8,4)
self.chkOrigTeamBal:SetText( PHX:QTrans( "PHXM_ADMIN_TEAMBAL_ORIG" ) )
self.chkOrigTeamBal:SetFont( "HudHintTextLarge" )
self.chkOrigTeamBal:SetValue( GetConVar("ph_originalteambalance"):GetBool() )
function self.chkOrigTeamBal:OnChange(bool)
self.chkOrigTeamBal:SetValue( PHX:GetCVar( "ph_originalteambalance" ) )
function self.chkOrigTeamBal:OnChange(bool)
local v = "0"
if (bool) then v = "1" end

net.Start( "SvCommandReq" )
net.WriteString( "ph_originalteambalance" )
net.WriteString( bool and "1" or "0" )
net.WriteString( v )
net.SendToServer()
end

Expand Down
19 changes: 16 additions & 3 deletions gamemodes/prop_hunt/gamemode/enhancedplus/sh_enhancedplus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ PHEPLUSCVAR["ph_unstuckrange"] = { CTYPE_NUMBER, "250", FCVAR_SERVER_ONLY_
PHEPLUSCVAR["ph_disabletpunstuckinround"] = { CTYPE_BOOL, "0", FCVAR_SERVER_ONLY, "Disable last-resort unstuck teleportations to spawnpoints outside of the hiding phase" }
PHEPLUSCVAR["ph_unstuck_waittime"] = { CTYPE_NUMBER, "5", FCVAR_SERVER_ONLY, "How much in seconds must pass between each unstuck attempt" }

PHEPLUSCVAR["ph_originalteambalance"] = { CTYPE_BOOL, "0", FCVAR_SERVER_ONLY, "Use default PH:X/E+ original auto-balancing (disables all following team-related options)" }
PHEPLUSCVAR["ph_originalteambalance"] = { CTYPE_BOOL, "0", FCVAR_SERVER_ONLY, "Use default PH:X/E+ original auto-balancing (disables all following team-related options)",
function(cvarname, value)
cvars.AddChangeCallback( cvarname, function(cv, _, new)

if (not tobool(new)) then
for _,v in pairs(player.GetAll()) do
v:PHXChatInfo("NOTICE", "FORCE_JOIN_TEAM_IS_DISABLED")
end
RunConsoleCommand("ph_force_join_balanced_teams", "0")
end

SetGlobalBool(cvarname, tobool(new))
end, "phx.cvbool_" .. cvarname)
end }
PHEPLUSCVAR["ph_rotateteams"] = { CTYPE_BOOL, "0", FCVAR_SERVER_ONLY, "Disable shuffle mode and rotate players instead" }
PHEPLUSCVAR["ph_huntercount"] = { CTYPE_NUMBER, "0", FCVAR_SERVER_ONLY, "Hunter count (0 = automatic)" }
PHEPLUSCVAR["ph_preventconsecutivehunting"] = { CTYPE_BOOL, "1", FCVAR_SERVER_ONLY, "Prevent players from being a Hunter twice in a row (shuffle mode only)" }
Expand All @@ -23,7 +36,7 @@ function GM:TeamHasEnoughPlayers( teamid )
local PlayerCount = team.NumPlayers( teamid )

-- Don't let them join a team if it has more players than another team
if PHX:GetCVar( "ph_forcejoinbalancedteams" ) then
if PHX:GetCVar( "ph_force_join_balanced_teams" ) then

for id, tm in pairs( team.GetAllTeams() ) do
if ( id > 0 && id < 1000 && team.NumPlayers( id ) < PlayerCount && team.Joinable(id) ) then return true end
Expand Down Expand Up @@ -65,7 +78,7 @@ function GM:CustomTeamHasEnoughPlayers(teamid, pl)
return GAMEMODE:TeamHasEnoughPlayers(teamid)
end

if PHX:GetCVar( "ph_forcejoinbalancedteams" ) then
if PHX:GetCVar( "ph_force_join_balanced_teams" ) then
local playerCount = GAMEMODE:GetPlayingCount(pl)
local teamPlayerCount = team.NumPlayers(teamid)
local hunterCount = GAMEMODE:GetHunterCount(playerCount)
Expand Down
3 changes: 2 additions & 1 deletion gamemodes/prop_hunt/gamemode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,11 @@ local function AutoRespawnCheck(ply)
local tim = PHX:GetCVar( "ph_allow_respawnonblind_team_only" )
if tim > 0 and ply:Team() == tim then
ply:Spawn()
--ply:PHXChatInfo( "NOTICE", "BLIND_RESPAWN_TEAM", team.GetName( tim ), math.Round(phx_blind_unlocktime - CurTime()) )
ControlTauntWindow(0)
ply:PHXChatInfo( "NOTICE", "BLIND_RESPAWN_TEAM", PHX:TranslateName( tim, ply ), math.Round(phx_blind_unlocktime - CurTime()) )
elseif tim == 0 then
ply:Spawn()
ControlTauntWindow(0)
ply:PHXChatInfo( "NOTICE", "BLIND_RESPAWN", math.Round(phx_blind_unlocktime - CurTime()) )
end
end
Expand Down
Loading

0 comments on commit ffad2dd

Please sign in to comment.