ok a bump im geting pissed about this i tried doing this and got it to work just not with a not alive aswell so im going to copy paste my code
local function PrintDamageLog(ply)
local pr = GetPrintFn(ply)
if (not IsValid(ply)) or ply:IsSuperAdmin() or GetRoundState() != ROUND_ACTIVE then
ServerLog(Format("%s used ttt_print_damagelog\n", IsValid(ply) and ply:Nick() or "console"))
pr("*** Damage log:\n")
if not dmglog_console:GetBool() then
pr("Damage logging for console disabled. Enable with ttt_log_damage_for_console 1.")
end
for k, txt in ipairs(GAMEMODE.DamageLog) do
pr(txt)
end
pr("*** Damage log end.")
end
if not ply:alive() then
if ply:IsUserGroup("admin") or ply:IsUserGroup("moderator") then
ServerLog(Format("%s used ttt_print_damagelog\n", IsValid(ply) and ply:Nick() or "console"))
pr("*** Damage log:\n")
if not dmglog_console:GetBool() then
pr("Damage logging for console disabled. Enable with ttt_log_damage_for_console 1.")
end
for k, txt in ipairs(GAMEMODE.DamageLog) do
pr(txt)
end
pr("*** Damage log end.")
end
else
if IsValid(ply) then
pr("You do not appear to be RCON or a superadmin, nor are we in the post-round phase!")
end
end
end
concommand.Add("ttt_print_damagelog", PrintDamageLog)
vinnila code is here
local function PrintDamageLog(ply)
local pr = GetPrintFn(ply)
if (not IsValid(ply)) or ply:IsSuperAdmin() or GetRoundState() != ROUND_ACTIVE then
ServerLog(Format("%s used ttt_print_damagelog\n", IsValid(ply) and ply:Nick() or "console"))
pr("*** Damage log:\n")
if not dmglog_console:GetBool() then
pr("Damage logging for console disabled. Enable with ttt_log_damage_for_console 1.")
end
for k, txt in ipairs(GAMEMODE.DamageLog) do
pr(txt)
end
pr("*** Damage log end.")
else
if IsValid(ply) then
pr("You do not appear to be RCON or a superadmin, nor are we in the post-round phase!")
end
end
end
concommand.Add("ttt_print_damagelog", PrintDamageLog)