Ulysses
General => Developers Corner => Topic started 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?
-
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)
-
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?
-
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.