Ulysses

General => Developers Corner => Topic started by: LegendProtocol on March 15, 2015, 07:08:23 PM

Title: Voice Drain Specific Players
Post by: LegendProtocol 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?
Title: Re: Voice Drain Specific Players
Post by: JamminR 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 (http://wiki.garrysmod.com/page/GM/PlayerStartVoice)
and
PlayerEndVoice - http://wiki.garrysmod.com/page/GM/PlayerEndVoice (http://wiki.garrysmod.com/page/GM/PlayerEndVoice)

Title: Re: Voice Drain Specific Players
Post by: LegendProtocol 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?
Title: Re: Voice Drain Specific Players
Post by: JamminR 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.