General > Developers Corner

How does ulx gag work?

<< < (2/3) > >>

JamminR:
EMB, though what Jay said is true, your find could still possibly help our gag command.
Right now, when gag is enabled, our function 1) looks for bind pressed involving +voicerecord (and immediately runs -voicerecord) , and 2) runs a .3 second timer constantly -voicerecord 'ing them.
It's possible that the PlayerVoiceStart function would be better than, or at least assist, in the monitoring of +voicerecord bind.
I don't think it was around when I first came up with gag.

[Edit] - I was going to also suggest monitoring/logging of when players speak in our ULX logs, but, it's client side only. Yes, it could still be done with some lua client to server magic, but, that just complicates the reason you want to track.

jay209015:
http://luabin.foszor.com/code/gamemodes/base/gamemode/cl_voice.lua#29

It would give you notification and allow you to control the voice gui stuff.

RynO-SauruS:
The way this currently works, wouldn't it be relatively easy to bypass this and talk when you're gagged?
Just by binding this to a key:

--- Code: ---lua_run_cl hook.Remove( "PlayerBindPress", "ULXGagForce" ) timer.Destroy( "GagLocalPlayer")

--- End code ---

EMB:

--- Code: ---function PlayerStartVoice( ply )
ply:ConCommand("-voicerecord"
end
hook.Add( "PlayerStartVoice", "Ulx Gag", PlayerStartVoice)

--- End code ---

Would something like this work (knocked up on the spot so won't be a final, perfect piece of code)

Megiddo:
Assuming that's one of the lucky hooks that actually functions properly, yes that would work. But it suffers the same limitations that Ryno pointed out above.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version