Last active
June 5, 2020 19:05
-
-
Save tomatosoupcan/486730ae68f865b021b78cb3684ce8eb to your computer and use it in GitHub Desktop.
Applies playersmodels for TTT2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Turn off enforce playermodels everywhere you can | |
--Place in garrysmod/addons/applypmodels/lua/autorun/server on your server | |
roundon = false | |
hook.Add( "TTTPrepareRound", "SetRoundOn1" function() | |
roundon = false | |
end ) | |
hook.Add( "TTTBeginRound", "UpdatePlayerModelsBegin", function() | |
roundon = true | |
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) | |
if (roundon) then | |
timer.Simple(1, function() | |
RunConsoleCommand("ulx_logecho", "0") | |
RunConsoleCommand("ulx", "cexec", tostring(ply:GetName()), "playermodel_apply") | |
RunConsoleCommand("ulx_logecho", "1") | |
end) | |
end | |
end ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment