Random Server T-Posing

Does anybody know what may cause these to happen and how to prevent them?

This one happened on one of my prophunt servers, completely random out of the 6 months I’ve had it. It also tends to happen on my TTT servers too a bit often.

Do you have Pointshop installed?

Yes I do.

Something isn’t setting the model correctly then.

What do you mean by that? That the model itself is bad? This happens to everybody on the server, not just one player. The servers have default HL2 models and a Chell model, no custom stuff.

Post your code from a model that is causing this.

I do not know which model causes this specifically. You can view all the playermodels that are on the servers here: http://compactgamers.com/storage/files/garrysmod/8-18-14_psdefmodels/

I’m talking about specific code.

What specific code? These are the only files that set models, nothing else. The gamemode itself may set the models to the default ones it comes with, but that’s it.

Then post the code from the gamemode that sets the model. I can’t just guess what’s causing the issue without looking specifically.

You’ll be able to find the code here: http://compactgamers.com/storage/files/garrysmod/8-18-14_ph_init/init.lua

// Called when player needs a model
function GM:PlayerSetModel(pl)
	local player_model = "models/Gibs/Antlion_gib_small_3.mdl"
	if pl:Team() == TEAM_HUNTERS then
		player_model = "models/player/combine_super_soldier.mdl"

// 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
	if pl:Team() == TEAM_PROPS && pl:IsOnGround() && !pl:Crouching() && table.HasValue(USABLE_PROP_ENTITIES, ent:GetClass()) && ent:GetModel() then
		if table.HasValue(BANNED_PROP_MODELS, ent:GetModel()) then
			pl:ChatPrint("That prop has been banned by the server.")
		elseif ent:GetPhysicsObject():IsValid() && pl.ph_prop:GetModel() != ent:GetModel() then
			local ent_health = math.Clamp(ent:GetPhysicsObject():GetVolume() / 250, 1, 200)
			local new_health = math.Clamp((pl.ph_prop.health / pl.ph_prop.max_health) * ent_health, 1, 200)
			local per = pl.ph_prop.health / pl.ph_prop.max_health
			pl.ph_prop.health = new_health
			pl.ph_prop.max_health = ent_health
			pl.ph_prop:SetPos(pl:GetPos() - Vector(0, 0, ent:OBBMins().z))
			local hullxymax = math.Round(math.Max(ent:OBBMaxs().x, ent:OBBMaxs().y))
			local hullxymin = hullxymax * -1
			local hullz = math.Round(ent:OBBMaxs().z)
			pl:SetHull(Vector(hullxymin, hullxymin, 0), Vector(hullxymax, hullxymax, hullz))
			pl:SetHullDuck(Vector(hullxymin, hullxymin, 0), Vector(hullxymax, hullxymax, hullz))
			umsg.Start("SetHull", pl)

Though this happens rarely on the PropHunt servers, it tends to happen on the TTT servers too when a new map is voted to. The preparing timer gets stuck.

I just noticed I have missed an update for the gamemode. I will update it when I get back.