Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plogs.Register('Kills', true, Color(255,0,0))
- function rone_ttt_printrole(ply)
- if ply:IsPlayer() then
- if ply:GetRole() == 0 then
- return "innocent"
- elseif ply:GetRole() == 1 then
- return "traitor"
- elseif ply:GetRole() == 2 then
- return "detective"
- else
- return ""
- end
- else
- return ""
- end
- end
- plogs.AddHook('PlayerDeath', function(pl, _, attacker)
- local copy = {
- ['Name'] = pl:Name(),
- ['SteamID'] = pl:SteamID(),
- }
- local weapon = ''
- if IsValid(attacker) then
- if attacker:IsPlayer() then
- copy['Attacker Name'] = attacker:Name()
- copy['Attacker SteamID'] = attacker:SteamID()
- weapon = ' with ' .. (IsValid(attacker:GetActiveWeapon()) and attacker:GetActiveWeapon():GetClass() or 'unknown')
- attacker = attacker:NameID()
- else
- if attacker.CPPIGetOwner and IsValid(attacker:CPPIGetOwner()) then
- weapon = ' with ' .. attacker:GetClass()
- attacker = attacker:CPPIGetOwner():NameID()
- else
- attacker = attacker:GetClass()
- end
- end
- else
- attacker = tostring(attacker)
- end
- if not ( pl == attacker ) then
- rone_victim_team = rone_ttt_printrole(pl)
- rone_attacker_team = rone_ttt_printrole(attacker)
- else
- rone_victim_team = ""
- rone_attacker_team = ""
- end
- plogs.PlayerLog(pl, 'Kills', "[" .. rone_attacker_team "] " .. attacker .. ' killed ' .. "[" .. rone_victim_team .. "] " .. pl:NameID() .. weapon, copy)
- end)
- plogs.Register('Damage', false)
- plogs.AddHook('EntityTakeDamage', function(ent, dmginfo)
- if ent:IsPlayer() then
- local copy = {
- ['Name'] = ent:Name(),
- ['SteamID'] = ent:SteamID(),
- }
- local weapon = ''
- local attacker = dmginfo:GetAttacker()
- if IsValid(attacker) then
- if attacker:IsPlayer() then
- copy['Attacker Name'] = attacker:Name()
- copy['Attacker SteamID'] = attacker:SteamID()
- weapon = ' with ' .. (IsValid(attacker:GetActiveWeapon()) and attacker:GetActiveWeapon():GetClass() or 'unknown')
- attacker = attacker:NameID()
- else
- if attacker.CPPIGetOwner and IsValid(attacker:CPPIGetOwner()) then
- weapon = ' with ' .. attacker:GetClass()
- attacker = attacker:CPPIGetOwner():NameID()
- else
- attacker = attacker:GetClass()
- end
- end
- else
- attacker = tostring(attacker)
- end
- plogs.PlayerLog(ent, 'Damage', attacker .. ' did ' .. math.Round(dmginfo:GetDamage(), 0) .. ' damage to ' .. ent:NameID() .. weapon, copy)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement