Ulysses

General => Developers Corner => Topic started by: Moka on February 20, 2013, 11:21:19 PM

Title: Stopping Movement
Post by: Moka on February 20, 2013, 11:21:19 PM
Is there anyway I could stop all player movement when I call 'GM:ScoreboardShow()'?
Tried using 'GM:CreateMove' but seeing as the gmod wiki doesn't like having pages I need I come to ask you guys for some assistance.
Tried using 'GM:Move' but it doesn't seem to work.
Title: Re: Stopping Movement
Post by: nathan736 on February 21, 2013, 06:17:22 AM
what your asking could  -not sure- be exploited to prevent fall damage floating in the air and other things if your talking stop as in no user key input just run on client
the - keys for movement or what ever it is its probably the cheating way but eh does the same thing in the end
Title: Re: Stopping Movement
Post by: Moka on February 21, 2013, 09:01:25 AM
I am trying to get the player to stop moving when the scoreboard is open. Like seeing if KeyDown IN_FORWARD or something then returning nothing.
Title: Re: Stopping Movement
Post by: nathan736 on February 21, 2013, 09:55:33 AM
just add concommands -foward -left -right -back
make sure you don't target every one
Title: Re: Stopping Movement
Post by: JamminR on February 21, 2013, 02:58:47 PM
I think there are hooks for scoreboard viewing.
Research them, then combine them with a freeze command stuff we use in ULX.

EDIT - yep-
 http://wiki.garrysmod.com/index.php?title=Hooks/Base/ScoreboardHide and http://wiki.garrysmod.com/index.php?title=Hooks/Base/ScoreboardShow
(No, they don't have content explaining, but heck, test them, learn how they work if you can, then update the Wiki.)

Title: Re: Stopping Movement
Post by: MrPresident on February 27, 2013, 11:08:53 PM
Code: [Select]
function My_ScoreBoardShow( ply )
    ply:Freeze(true)
end
hook.Add("ScoreboardShow", "My_ScoreBoardShow", My_ScoreBoardShow)

function My_ScoreBoardHide( ply )
    ply:Freeze(false)
end
hook.Add("ScoreboardHide", "My_ScoreBoardHide", My_ScoreBoardHide)

I did this from my phone in a hospital bed... There are no guarantees that this will outright work for you.
Title: Re: Stopping Movement
Post by: krooks on March 01, 2013, 06:33:10 PM
hospital bed  :-\
hope you're alright?
Title: Re: Stopping Movement
Post by: JamminR on March 01, 2013, 09:10:24 PM
Krooks, MrP went in for brain surgery.
Long story short, he's such a genius with a big brain that they had to remove some of it that was extending into his spinal column to prevent his head from exploding.
Or at least, prevent the headaches that had been happening for a long time due to his big brain.

(http://image.shutterstock.com/display_pic_with_logo/3288/98874164/stock-photo-man-before-big-brain-98874164.jpg)

[Though I joke, the medical condition he underwent surgery for did cause extension of brain and fluid into spinal column)
Title: Re: Stopping Movement
Post by: krooks on March 02, 2013, 08:46:29 PM
@.@ Not trying to hijack the thread, but sending prayers your way MrP! I hope they leave the good parts, like the parts that help us with lua. ;P