On my server I have it so its all talk (sv_alltalk 1) so everyone can talk to eachother. but is their a way to have all talk and team voice chat at the same time? by lets say pressing z to team chat? so you could use x for all talk and z for team chat.
[B][URL="http://wiki.garrysmod.com/page/GM/PlayerCanHearPlayersVoice"]GM:PlayerCanHearPlayersVoice[/URL][/B]
You could have a command or bind that toggle whether or not the player is talking to his team, basically if the talker has team-chat on then they will hear each other if the team of talker is equal to the team of listener.
thats a good start I would also have to have something in the code that it points press z to talk for team chat which would be GM:KeyPress?
Yes if you plan on using a key that you can map in your controls settings.
cool, im not sure what file to add it too though? should i just have it run as an addon?
Yes, in the addon put it in [B]lua/autorun/server/coolLuaFile.lua[/B]
great thank you so much for your help!
I tried to write a little something for my server so that there can be team voice chat by pressing z. But i cant seem to get it to work. heres what i got.
[lua]
local sv_alltalk = GetConVar( "sv_alltalk" )
function GM:PlayerCanHearPlayersVoice( pListener, pTalker )
local alltalk = sv_alltalk:GetInt()
if ( key == KEY_Z ) then
sv_alltalk = 1
return pListener:Team() == pTalker:Team(), false
end
[/lua]
can anyone help me out with this?
Sorry, you need to Log In to post a reply to this thread.