General > Developers Corner

Voice Drain Specific Players

(1/1)

LegendProtocol:
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?

JamminR:
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

LegendProtocol:
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?

JamminR:
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.





Navigation

[0] Message Index

Go to full version