i wanted to try making a prank similar to
https://www.youtube.com/watch?v=0ukmWKjEkqo
but aperently you aren't allowed to use the volume command via lua, so i need some kind of bypass or work around
The only way i can come up with is executing stopsound rapidly on the client. This will mute everything including voice activity.
could be really laggy
why did it take 10 years for them to blacklist the volume command?
You could try:
for k, v in pairs(player.GetAll()) do
v:SendLua("RunConsoleCommand(\'volume\', 0)")
end
You can store the previous volume level they had with
ply.oldVolume = GetConVar("volume"):GetFloat()
and mute the sound with
ply:ConCommand("volume 0")
then restore it back if needed:
ply:ConCommand("volume "..ply.oldVolume)
the command is blocked, you cannot change the volume cvar, i need a bypass or some other way to mute all in game sounds
Use GM/EntityEmitSound this hook and return false to prevent sounds
Well, it was not blocked last time I checked, I used it in my addon to mute the sound for a specific duration of time
] lua_run_cl RunConsoleCommand'volume'
RunConsoleCommand: Command is blocked! (volume)
straight from my console, though maybe they haven't done this to the main branch yet
It is blocked on Dev branch and will be blocked in future update. Reason being, that the convar saves its value across sessions.
Darn, this was useful in some cases. Anyway, good to know.
that will mute everything for everyone, what i need is to make it so the game is mute for the client we are pranking
Run it clientside and check if LocalPlayer() equals the target player
why did it take you so long to block it then?
also clients can just add this to their autoexec
alias volume "echo blocked volume"
the same can be said about any other cvars that clients don't want the server to mess with.
finally _restart, would you rather the server run
while true do end
or
cam.End3d()
on people?
Sorry, you need to Log In to post a reply to this thread.