Hellfox, great! I wouldn't have thought of that but it does make sense, I've noticed that if you try to call certain functionality too soon within an event, it will act as if the function itself doesn't exist, rather annoying!
I look forward to your work-around.
Cheers.
------------------------------------------
Fix 1 - This is the way you want to try first, the second method was me deciding to start thinking like Garry to fix a Garry glitch.
------------------------------------------
Just try changing Line 66...
if not user_to_gag:IsMuted() or was_gagged then return end
to...
if not (v.gimp == 2) or was_gagged then return end
-----------------------------------------
Fix 2 - The insane/unstable way.
------------------------------------------
Okay here is the code, so I wanted to replicate the ULX freeze command and make one that takes an extra var where you can choose if it silently freezes the player or just says "Someone froze Jacob"
Any way here is the code for it...
function ulx.gunfreeze( calling_ply, target_plys, should_unfreeze, hide_echo, isFrozen )
if( SERVER ) then -- This part right here is what interests you! (At least it worked for me as a fix.)
local affected_plys = {}
for i=1, #target_plys do
if not should_unfreeze and ulx.getExclusive( target_plys[ i ], calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( target_plys[ i ], calling_ply ), true )
else
local v = target_plys[ i ]
if v:InVehicle() then
v:ExitVehicle()
end
if not should_unfreeze then
v:Lock()
v.frozen = true
ulx.setExclusive( v, "frozen" )
else
v:UnLock() --The error was happening here where UnLock() would "not exsist".
v.frozen = nil
ulx.clearExclusive( v )
end
v:DisallowSpawning( not should_unfreeze )
ulx.setNoDie( v, not should_unfreeze )
table.insert( affected_plys, v )
if v.whipped then
v.whipcount = v.whipamt -- Will make it remove
end
end
end
if not hide_echo then
if not should_unfreeze then
ulx.fancyLogAdmin( calling_ply, "#A froze #T", affected_plys )
else
ulx.fancyLogAdmin( calling_ply, "#A unfroze #T", affected_plys )
end
else
if not should_unfreeze then
ulx.fancyLogAdmin( calling_ply, true, "#A froze #T", affected_plys )
elseif( isFrozen ) then
ulx.fancyLogAdmin( calling_ply, true, "#A unfroze #T", affected_plys )
end
end
end
end
local gunfreeze = ulx.command( CATEGORY_NAME, "ulx gunfreeze", ulx.gunfreeze, "!gunfreeze" )
gunfreeze:addParam{ type=ULib.cmds.PlayersArg }
gunfreeze:addParam{ type=ULib.cmds.BoolArg, invisible=true }
gunfreeze:defaultAccess( ULib.ACCESS_ADMIN )
gunfreeze:help( "Used for freezing players with the physgun!" )
gunfreeze:setOpposite( "ulx ungunfreeze", {_, _, true}, "!ungunfreeze" )
In short what you want to do is take that module and make it run on shared then change this line (Line 66) "if not user_to_gag:IsMuted() or was_gagged then return end" to "if SERVER and not (user_to_gag:IsMuted() or was_gagged) then return end".
Disclaimer: Both of these are just guesses based on my own experience, I hope they help you.