Garry's Mod

Garry's Mod

Enhanced PlayerModel Selector
[TTT2] Enhanced PlayerModel Selector conflict with trouble in terrorist town 2
So I spent a few hours tweeking and finally found a way to get this mod to work with TTT2.

For background this mod and TTT2 uses the same class assignment to force a model change. The problem is the TTT2 class starts the round, so, with both installed the rounds won't start in TTT2. To fix this you need to disable "force playermodel" for both server and client in the settings menu for the model changer. This means you can set a player model for the rounds but each prep/round resets the model. Having to change your model twice each round reset is...inconvenient.

luckily this mod offers the command "playermodel_apply" which sets your model according to your settings with no GUI. Thus the next problem comes as how to run it, auto running is easiest but I couldn't find an easy way to do it. Finally we come to:
https://steamcommunity.com/sharedfiles/filedetails/?id=1673119444
This mod offers easy bindings for TTT2 with the addition of not being the same as bindings for Gmod. This means we can assign a key like "w" to a binding and our model will update each time we go forward. All thats left is to use the xgui(ULX mod) > custom bindings to register a model change button and your good to go. (besides each player have to set the key in F1 > key bindings)

Not the simplest way but its a "fix"
TL:DR
1: disable force model change in EPMS (client and server)
2: install "[TTT2] Easy Custom Bindings" and register a new keybind
3: have everyone assign the button to something they use or can hit easy.
4: enjoy TTT2
5: come up with a better way to do this and tell the rest of us
Last edited by Deathbyfarting; Jul 9, 2019 @ 10:10am
< >
Showing 1-6 of 6 comments
Alf21 Jul 9, 2019 @ 10:53am 
Seems like DDOS'ing the server xD But it's a fix. There need to be a hook into playermodel selector or they need to add ttt2 support, but on the ttt2 side, there is nothing to do without breaking other addons :/
cs.funnyace Mar 30, 2020 @ 8:02am 
do in need to disable "force playermodel" while beeing in the server becurse the server option wont show up there.
and i gues i have to add Enhanced PlayerModel Selector to the server resurce list to?
tomatosoup May 29, 2020 @ 11:41am 
I realize this is a bit of a necro bump here, but some info for people who want to get Advanced Disguiser and other features working properly while using Enhanced Player Model Selector and TTT2 or TTT. You are required to have ULX installed in order for this to work properly, but I presume anyone using TTT2 already has it.

Step 1: Uncheck Enforce Playermodel in settings for EPMS, client settings for EPMS (each player will have to do this), and TTT2 settings.

Step 2: On server create folder structure: garrysmod\addons\applymodels\lua\server\applymodels.lua

Step 3: Write the following to applymodels.lua

hook.Add( "TTTPrepareRound", "RandomizeTPercentage", function()
for k, v in pairs( player.GetAll() ) do
RunConsoleCommand("ulx_logecho", "0")
RunConsoleCommand("ulx", "cexec", tostring(v:GetName()), "playermodel_apply")
RunConsoleCommand("ulx_logecho", "1")
end
end )

hook.Add( "TTTBeginRound", "UpdatePlayerModels", function()
for k, v in pairs ( player.GetAll() ) do
RunConsoleCommand("ulx_logecho", "0")
RunConsoleCommand("ulx", "cexec", tostring(v:GetName()), "playermodel_apply")
RunConsoleCommand("ulx_logecho", "1")
end
end )


Step 4: Save your applymodels.lua file and either change maps or restart your server, not sure which is required.

This will make the server send a "playermodel_apply" to each active player at the start of each prep phase and round start. Much better than binding a key and spamming it.
Last edited by tomatosoup; May 29, 2020 @ 11:42am
tomatosoup May 30, 2020 @ 7:04am 
hook.Add( "TTTBeginRound", "UpdatePlayerModels", function()
timer.Simple(1, function() round = true end)
for k, v in pairs ( player.GetAll() ) do
RunConsoleCommand("ulx_logecho", "0")
RunConsoleCommand("ulx", "cexec", tostring(v:GetName()), "playermodel_apply")
RunConsoleCommand("ulx_logecho", "1")
end
end )

hook.Add( "PlayerSpawn", "PlayerLoadingOut", function( ply )
RunConsoleCommand("ulx_logecho", "0")
RunConsoleCommand("ulx", "cexec", tostring(ply:GetName()), "playermodel_apply")
RunConsoleCommand("ulx_logecho", "1")
end )

Ended up working better for me in the end, to get players to respawn with their model if they respawn in the middle of a round. Have not yet stability tested.
BUCKET Jul 14, 2020 @ 7:25pm 
Hey! I found a quick and easy, temporary workaround. Apparently both TTT and the EPMS use the same SetMDL function, which is what's causing problems at the start of the round. Setting ttt_enforce_playermodel to 0 in the console will disable TTT's playermodel enforcement, allowing one to use the playermodel selector without errors.
tomatosoup Jul 14, 2020 @ 10:36pm 
Can you confirm that works with disguisers as well? And are you speaking on TTT or TTT2?
< >
Showing 1-6 of 6 comments
Per page: 1530 50