ULX

Author Topic: Voice Drain Specific Players  (Read 1714 times)

0 Members and 1 Guest are viewing this topic.

Offline LegendProtocol

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
Voice Drain Specific Players
« on: March 15, 2015, 07:08:23 PM »
Does anyone have an idea on I could go about creating a ulx command to enable a voice limit/drain on a specific player for the TTT gamemode?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Voice Drain Specific Players
« Reply #1 on: March 15, 2015, 07:41:26 PM »
Sure.
They are client side though, so you'd need to perform some data/function calls between client/server to keep 'energy' use levels up to date on both.

PlayerStartVoicet - http://wiki.garrysmod.com/page/GM/PlayerStartVoice
and
PlayerEndVoice - http://wiki.garrysmod.com/page/GM/PlayerEndVoice

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

Offline LegendProtocol

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
Re: Voice Drain Specific Players
« Reply #2 on: March 16, 2015, 08:20:18 AM »
Thanks for the help JamminR.

I've modeled the command around gag, and what I have left to do is the core functionality. Can you give me an example on how I would  do  data/function calls between client/server to keep the energy levels current?
« Last Edit: March 16, 2015, 01:09:34 PM by LegendProtocol »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Voice Drain Specific Players
« Reply #3 on: March 16, 2015, 03:24:18 PM »
Ouch. It's been so long since I've done that much in depth I'd have to teach myself.
I just looked at our gag code.
Using our gag idea is actually better than what I thought my idea was.
Though you could (and probably should) use those hooks on client side to then start updating a GUI/HUD and counting, once the counter reached 'limit', use the basic server side hook to flag PlayerCanHearPlayersVoice as 'NO' like we do in gag.
SetNWBool sets the switch on server and client.





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