mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
39
lua/sam/modules/commnad_notify_for_ranks.lua
Normal file
39
lua/sam/modules/commnad_notify_for_ranks.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- Make command notifying only for ranks you select.
|
||||
-- permission is command_notify. (by default admin+ has it)
|
||||
-- You can NOT use this with 'command_hide_admin_name.lua'
|
||||
--
|
||||
if SAM_LOADED then return end
|
||||
|
||||
sam.permissions.add("command_notify", nil, "admin")
|
||||
|
||||
if SERVER then
|
||||
local get_players = function()
|
||||
local players = {}
|
||||
for _, v in ipairs(player.GetAll()) do
|
||||
if v:HasPermission("command_notify") then
|
||||
table.insert(players, v)
|
||||
end
|
||||
end
|
||||
return players
|
||||
end
|
||||
|
||||
sam.player.old_send_message = sam.player.old_send_message or sam.player.send_message
|
||||
function sam.player.send_message(ply, msg, tbl)
|
||||
if ply == nil and debug.traceback():find("lua/sam/command/", 1, true) then
|
||||
sam.player.old_send_message(get_players(), msg, tbl)
|
||||
else
|
||||
sam.player.old_send_message(ply, msg, tbl)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user