• I need to stop the movement of players on the server.
    13 replies, posted
Hi everyone. I need to stop the movement of players on the server, but only walking. Shooting, and the movement of the mouse should be left. How to do this? (Entity:Freeze does not fit)
Did you try this? CUserCmd/ClearMovement
I will need to later remove ban the movement of players. I'm thinking of using the StartCommand hook. But I have not figured it out yet.
Could you disable/enable: PLAYER Enumerations ??
I understand this is necessary for working with animations. But I need to prohibit not the animation but the movement of players.
Take a look here GM/SetupMove
i need any example
hook.Add("CreateMove", "Sticky", function(cmd)     if CONDITION then         cmd:SetForwardMove( 0 )         cmd:SetSideMove( 0 ) end end)
Posting this just in case somewhere down the line google decides to bury one of the threads: hook.Add("StartCommand", "NullControl", function(ply, CUserCmd) for k,v in pairs(player.GetAll()) do if v:Alive() then CUserCmd:ClearMovement() CUserCmd:RemoveKey( 1 ) --See: https://wiki.garrysmod.com/page/Enums/IN CUserCmd:RemoveKey( 2 ) CUserCmd:RemoveKey( 4 ) end end end)
Don't use decimal numerations, use IN_FORWARD, IN_MOVELEFT, etc
Ah okay I was just following this: https://wiki.garrysmod.com/page/CUserCmd/RemoveKey And didn't see the warning on the IN_ENUM page
The warning is true for any and all enums in Garry's Mod
There is a warning, you just didn't spot it :p http://www.kyle93.co.uk/i/32fd5.png The decimal value of the enumerations can be completely different between different versions of GMod because enumerations can be added or removed in between each one, throwing the order completely off. ALWAYS use the name, never the number.
Thank you very much for your answers. You really helped
Sorry, you need to Log In to post a reply to this thread.