ULX

Author Topic: Stopping Movement  (Read 3469 times)

0 Members and 1 Guest are viewing this topic.

Offline Moka

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Stopping Movement
« 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.

Offline nathan736

  • Full Member
  • ***
  • Posts: 143
  • Karma: 4
Re: Stopping Movement
« Reply #1 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
« Last Edit: February 21, 2013, 08:27:38 AM by nathan736 »
a person asked me how to code lua and i said this " its like building a rocket up side down then  realizing you did it all wrong."

Offline Moka

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: Stopping Movement
« Reply #2 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.

Offline nathan736

  • Full Member
  • ***
  • Posts: 143
  • Karma: 4
Re: Stopping Movement
« Reply #3 on: February 21, 2013, 09:55:33 AM »
just add concommands -foward -left -right -back
make sure you don't target every one
a person asked me how to code lua and i said this " its like building a rocket up side down then  realizing you did it all wrong."

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Stopping Movement
« Reply #4 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.)

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Stopping Movement
« Reply #5 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.

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Re: Stopping Movement
« Reply #6 on: March 01, 2013, 06:33:10 PM »
hospital bed  :-\
hope you're alright?
My TTT server. Join the fun!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Stopping Movement
« Reply #7 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.



[Though I joke, the medical condition he underwent surgery for did cause extension of brain and fluid into spinal column)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Re: Stopping Movement
« Reply #8 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
My TTT server. Join the fun!