SLogs:Hook("SAM.ParsedCommand", function(ply, cmd, args)
local plyName = (IsValid(ply) and ply:IsPlayer()) and SLogs:ValidCall(ply, "GetName") or "КОНСОЛЬ"
local plySID = (IsValid(ply) and ply:IsPlayer()) and SLogs:ValidCall(ply, "SteamID") or "N/A"
local target
if istable(args) and args[1] then
local maybeTarget = args[1]
if istable(maybeTarget) then
if IsValid(maybeTarget[1]) and maybeTarget[1]:IsPlayer() then
target = maybeTarget[1]
end
elseif IsValid(maybeTarget) and maybeTarget:IsPlayer() then
target = maybeTarget
end
end
local args_str
local startIndex = target and 2 or 1
for i = startIndex, #args do
local v = args[i]
if v ~= nil and not isbool(v) then
args_str = (args_str and (args_str .. ", ") or "") .. tostring(v)
end
end
if target then
return {
T = "SAMID",
I = Either(args_str, 0, 2),
E = {
ply1 = plyName,
ply2 = SLogs:ValidCall(target, "GetName") or "Unknown",
sid1 = plySID,
sid2 = SLogs:ValidCall(target, "SteamID") or "N/A",
str1 = cmd,
str2 = args_str or "",
}
}
else
return {
T = "SAMID",
I = Either(args_str, 1, 3),
E = {
ply1 = plyName,
sid1 = plySID,
str1 = cmd,
str2 = args_str or "",
}
}
end
end)