• Mute a Player Serverwide - Lua
    7 replies, posted
Hey guys, I'm working on a gamemode. In the gamemode you need to start off muted serverwide, so no one can here you. Does anyone know a way in lua to mute/unmute a player to the whole server?
You can try using this hook and always returning false : [url]http://wiki.garrysmod.com/page/Hooks/Base/PlayerCanHearPlayersVoice[/url] [editline]27th February 2013[/editline] I mean, return false on the players you need to mute
I want to to be like this: On a player's initial spawn, if they're not admin, mute them. And then I need the command to unmute them. I don't know how to put together what you're saying.
Just use the hook and add a variable for the players. You can change the variable with a concommand.
[QUOTE=Chessnut;39740859]Just use the hook and add a variable for the players. You can change the variable with a concommand.[/QUOTE] What? I have no idea how to use the hook..
Do you think it's a good idea to make a gamemode then? Try something more simple.
[lua] hook.Add("PlayerInitialSpawn", "PlayerInitialSpawnMute", function(ply) ply.muted = true end) hook.Add("PlayerCanHearPlayersVoice", "PlayerCanHearPlayersVoiceMute", function(listener) if listener.muted then return false, false end end) [/lua] But then I don't know how your command would work (using something like ULX/Evolve?)
[QUOTE=Nalo;39740991][lua] hook.Add("PlayerInitialSpawn", "PlayerInitialSpawnMute", function(ply) ply.muted = true end) hook.Add("PlayerCanHearPlayersVoice", "PlayerCanHearPlayersVoiceMute", function(listener) if listener.muted then return false, false end end) [/lua] But then I don't know how your command would work (using something like ULX/Evolve?)[/QUOTE] Thanks, and I'm just gonna make my own console cmd to unmute [editline]27th February 2013[/editline] [QUOTE=ms333;39740981]Do you think it's a good idea to make a gamemode then? Try something more simple.[/QUOTE] It's a simple gamemode, derived from sandbox. I'm not doing crazy ultra PERP shit
Sorry, you need to Log In to post a reply to this thread.