Stopsounds script for server-side use?

Hey guys, not sure if its possible but I am looking for a script what allows me to run “stopsounds” on my dedicated server, but it doesn’t have to stop the sounds only for me but for every player in the server. Is this possible or is this command only clientside?

[lua]
concommand.Add(“Stopplayersounds”, function(ply)
if ply:IsAdmin() then
for _,p in pairs(player.GetAll()) do
p:ConCommand(“stopsounds”)
end
end
end)
[/lua]

[lua]
concommand.Add(“clean”, function(ply)
if ply:IsAdmin() then
BroadcastLua([[game.CleanUpMap()]])
end
end)
[/lua]

It cleans up all of the dead NPC ragdolls, decals, fires, and stops all sounds.

donkie is right, just broadcast the console command to everyone.

I placed this in a .lua file into autorun, I had this error when I tried to run it into the server

" [lua\autorun\stopsounds.lua:2] attempt to call method ‘IsAdmin’ (a nil value) "

[lua]
function AdminStopSounds(ply, c, a)
if(ply:IsAdmin()) then
for k,v in pairs(player.GetAll()) do
if(v) then
v:SendLua(“LocalPlayer():ConCommand(‘stopsounds’)”)
end
end
end
end
concommand.Add(“adminstopsounds”, AdminStopSounds)
[/lua]

Place it in lua/autorun/server

I dont think serverside can run “stopsounds” on a client (Not Sure)

Yeah, this works and it does stop the sounds for other players also. Epic thanks man :smiley:

No Problem :wink: