dobrograd-13-06-2022/garrysmod/addons/feature-gmpanel/lua/gmpanel/actions/messages/server.lua
Jonny_Bro (Nikita) e4d5311906 first commit
2023-11-16 15:01:19 +05:00

16 lines
532 B
Lua

gmpanel.registerAction('messages', function(data)
if data.action ~= '' then
data.action = ' ' .. data.action
end
data.players = gmpanel.buildTargets(data.players or {})
local msg = {octochat.textColors.rp, data.name, data.action}
if data.message ~= '' then
msg = {octochat.textColors.rp, data.name, data.action, ': ', color_white, data.message}
end
for _,pl in ipairs(data.players) do
octochat.talkTo(pl, unpack(msg))
if data.voice and data.message ~= '' then pl:DoVoice(data.message, data.voice, pl) end
end
end)