Initial commit

This commit is contained in:
2026-03-15 14:54:49 +03:00
commit 64f8029c06
4027 changed files with 254888 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
plogs.Register('AWarn', true, Color(153,51,102))
plogs.AddHook('AWarnPlayerWarned', function(targ, admin, reason)
plogs.PlayerLog(targ, 'AWarn', targ:NameID() .. ' was warned by ' .. admin:NameID() .. ' for ' .. reason, {
['Name'] = targ:Name(),
['SteamID'] = targ:SteamID(),
['Admin Name'] = admin:Name(),
['Admin SteamID'] = admin:SteamID(),
['Reason'] = reason,
})
end)
plogs.AddHook('AWarnPlayerIDWarned', function(steamid, admin, reason)
local targ = plogs.FindPlayer(steamid)
if IsValid(targ) then
plogs.PlayerLog(targ, 'AWarn', targ:NameID() .. ' was warned by ' .. admin:NameID() .. ' for ' .. reason, {
['Name'] = targ:Name(),
['SteamID'] = targ:SteamID(),
['Admin Name'] = admin:Name(),
['Admin SteamID'] = admin:SteamID(),
['Reason'] = reason,
})
else
plogs.Log('AWarn', steamid .. ' was warned by ' .. admin:NameID() .. ' for ' .. reason, {
['SteamID'] = steamid,
['Admin Name'] = admin:Name(),
['Admin SteamID'] = admin:SteamID(),
['Reason'] = reason,
})
end
end)
plogs.AddHook('AWarnLimitKick', function(pl)
plogs.PlayerLog(pl, 'AWarn', pl:NameID() .. ' was kicked for too many warnings', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID(),
})
end)
plogs.AddHook('AWarnLimitBan', function(pl)
plogs.PlayerLog(pl, 'AWarn', pl:NameID() .. ' was banned for too many warnings', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID(),
})
end)

View File

@@ -0,0 +1,11 @@
plogs.Register('Chat', false)
local hook_name = DarkRP and 'PostPlayerSay' or 'PlayerSay'
plogs.AddHook(hook_name, function(pl, text)
if (text ~= '') then
plogs.PlayerLog(pl, 'Chat', pl:NameID() .. ' said ' .. string.Trim(text), {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end
end)

View File

@@ -0,0 +1,14 @@
plogs.Register('Commands', false)
if (SERVER) then
concommand._Run = concommand._Run or concommand.Run
function concommand.Run(pl, cmd, args, arg_str)
if IsValid(pl) and pl:IsPlayer() and (cmd ~= nil) and (plogs.cfg.CommandBlacklist[cmd] ~= true) then
plogs.PlayerLog(pl, 'Commands', pl:NameID() .. ' has ran command "' .. cmd .. '" with args "' .. (arg_str or table.concat(args, ' ')) .. '"', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID(),
})
end
return concommand._Run(pl, cmd, args, arg_str)
end
end

View File

@@ -0,0 +1,19 @@
plogs.Register('Connections', true, Color(0,255,0))
plogs.AddHook('PlayerInitialSpawn', function(pl)
plogs.PlayerLog(pl, 'Connections', pl:NameID() .. ' has connected', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
if plogs.cfg.EnableMySQL then
plogs.sql.LogIP(pl:SteamID64(), pl:IPAddress())
end
end)
plogs.AddHook('PlayerDisconnected', function(pl)
plogs.PlayerLog(pl, 'Connections', pl:NameID() .. ' has disconnected', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end)

View File

@@ -0,0 +1,26 @@
plogs.Register('Handcuff', false)
plogs.AddHook('OnHandcuffed', function(pl, targ)
plogs.PlayerLog(pl, 'Handcuff', pl:NameID() .. ' cuffed ' .. targ:NameID(), {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID(),
['Target Name'] = targ:Name(),
['Target SteamID'] = targ:SteamID()
})
end)
plogs.AddHook('OnHandcuffBreak', function(pl, cuffs, friend)
if IsValid(friend) then
plogs.PlayerLog(pl, 'Handcuff', friend:NameID() .. ' uncuffed ' .. pl:NameID(), {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID(),
['Fried Name'] = friend:Name(),
['Target SteamID'] = friend:SteamID()
})
else
plogs.PlayerLog(pl, 'Handcuff', pl:NameID() .. ' broke free from thier handcuffs', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end
end)

View File

@@ -0,0 +1,235 @@
-- Hit logs
if plogs.cfg.LogTypes['hhh'] and plogs.cfg.LogTypes['hitmodule'] then
plogs.Register('Hits', true, Color(51, 128, 255))
plogs.AddHook('onHitAccepted', function(hitman, target, customer)
plogs.PlayerLog(hitman, 'Hits', hitman:NameID() .. ' accepted a hit on ' .. target:NameID() .. ' ordered by ' .. customer:NameID(), {
['Hitman Name'] = hitman:Name(),
['Hitman SteamID'] = hitman:SteamID(),
['Customer Name'] = customer:Name(),
['Customer SteamID'] = customer:SteamID(),
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
})
end)
plogs.AddHook('onHitCompleted', function(hitman, target, customer)
plogs.PlayerLog(hitman, 'Hits', hitman:NameID() .. ' completed a hit on ' .. target:NameID() .. ' ordered by ' .. customer:NameID(), {
['Hitman Name'] = hitman:Name(),
['Hitman SteamID'] = hitman:SteamID(),
['Customer Name'] = customer:Name(),
['Customer SteamID'] = customer:SteamID(),
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
})
end)
plogs.AddHook('onHitFailed', function(hitman, target)
plogs.PlayerLog(hitman, 'Hits', hitman:NameID() .. ' failed a hit on ' .. target:NameID(), {
['Hitman Name'] = hitman:Name(),
['Hitman SteamID'] = hitman:SteamID(),
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
})
end)
end
-- Names
plogs.Register('Names', true, Color(51, 128, 255))
plogs.AddHook('onPlayerChangedName', function(pl, old, new)
if IsValid(pl) and (old ~= nil) then
plogs.PlayerLog(pl, 'Names', pl:NameID() .. ' changed their name to ' .. new .. ' from ' .. old, {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end
end)
-- Job changes
plogs.Register('Jobs', true, Color(51, 128, 255))
plogs.AddHook('OnPlayerChangedTeam', function(pl, old, new)
if IsValid(pl) then
plogs.PlayerLog(pl, 'Jobs', pl:NameID() .. ' changed their job to ' .. team.GetName(new) .. ' from ' .. team.GetName(old), {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end
end)
-- Demotions
plogs.Register('Demotions', true, Color(51, 128, 255))
plogs.AddHook('onPlayerDemoted', function(demoter, demotee, reason)
if IsValid(demoter) and IsValid(demotee) then
plogs.PlayerLog(demoter, 'Demotions', demoter:NameID() .. ' started a demotion on ' .. demotee:NameID() .. ' for ' .. reason, {
['Target Name'] = demotee:Name(),
['Target SteamID'] = demotee:SteamID(),
['Demotee Name'] = demoter:Name(),
['Demotee SteamID'] = demoter:SteamID(),
})
end
end)
-- Police logs
plogs.Register('Police', true, Color(51, 128, 255))
plogs.AddHook('playerArrested', function(target, time, officer)
if IsValid(officer) then
plogs.PlayerLog(officer, 'Police', officer:NameID() .. ' arrested ' .. target:NameID(), {
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
['Officer Name'] = officer:Name(),
['Officer SteamID'] = officer:SteamID(),
})
end
end)
plogs.AddHook('playerUnArrested', function(target, officer)
if IsValid(officer) then
plogs.PlayerLog(officer, 'Police', officer:NameID() .. ' unarrested ' .. target:NameID(), {
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
['Officer Name'] = officer:Name(),
['Officer SteamID'] = officer:SteamID(),
})
else
plogs.Log('Police', target:NameID() .. ' has been released from jail.', {
['Name'] = target:Name(),
['SteamID'] = target:SteamID(),
})
end
end)
plogs.AddHook('playerWanted', function(target, officer, reason)
if IsValid(officer) then
plogs.PlayerLog(officer, 'Police', officer:NameID() .. ' wanted ' .. target:NameID() .. ' for ' .. reason, {
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
['Officer Name'] = officer:Name(),
['Officer SteamID'] = officer:SteamID(),
})
end
end)
plogs.AddHook('playerUnWanted', function(target, officer)
if IsValid(officer) then
plogs.PlayerLog(officer, 'Police', officer:NameID() .. ' unwanted ' .. target:NameID(), {
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
['Officer Name'] = officer:Name(),
['Officer SteamID'] = officer:SteamID(),
})
else
plogs.Log('Police', target:NameID() .. '\'s wanted has expired', {
['Name'] = target:Name(),
['SteamID'] = target:SteamID(),
})
end
end)
plogs.AddHook('playerWarranted', function(target, officer, reason)
if IsValid(officer) then
plogs.PlayerLog(officer, 'Police', officer:NameID() .. ' warranted ' .. target:NameID() .. ' for ' .. reason, {
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
['Officer Name'] = officer:Name(),
['Officer SteamID'] = officer:SteamID(),
})
end
end)
plogs.AddHook('playerUnWarranted', function(target, officer)
if IsValid(officer) then
plogs.PlayerLog(officer, 'Police', officer:NameID() .. ' unwarranted ' .. target:NameID(), {
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
['Officer Name'] = officer:Name(),
['Officer SteamID'] = officer:SteamID(),
})
else
plogs.Log('Police', target:NameID() .. '\'s warrant has expired', {
['Name'] = target:Name(),
['SteamID'] = target:SteamID(),
})
end
end)
-- Purchases
plogs.Register('Purchases', false)
plogs.AddHook('playerBoughtCustomEntity', function(pl, ent_tbl, ent)
plogs.PlayerLog(pl, 'Purchases', pl:NameID() .. ' purchased ' .. ent_tbl.name .. ' for $' .. ent_tbl.price, {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end)
-- Adverts
plogs.Register('Advert', false)
plogs.AddHook('onChatCommand', function(pl, cmd, arg_str)
if (cmd == 'advert') then
plogs.PlayerLog(pl, 'Advert', pl:NameID() .. ' adverted "' .. arg_str .. '"', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end
end)
-- Lockpicks
plogs.Register('Lockpick', false)
plogs.AddHook('lockpickStarted', function(pl)
plogs.PlayerLog(pl, 'Lockpick', pl:NameID() .. ' started lockpicking', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end)
plogs.AddHook('onLockpickCompleted', function(pl, succ)
plogs.PlayerLog(pl, 'Lockpick', pl:NameID() .. ' finished lockpicking ' .. (succ and 'successfully' or 'unsuccessfully'), {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end)
-- Door buys
plogs.Register('Doors', false)
plogs.AddHook('playerBoughtDoor', function(pl, ent, cost)
plogs.PlayerLog(pl, 'Doors', pl:NameID() .. ' bought a door for $' .. cost, {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end)
plogs.AddHook('playerSellDoor', function(pl, ent)
plogs.PlayerLog(pl, 'Doors', pl:NameID() .. ' sold a door', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end)
-- Pockets
plogs.Register('Pocket', false)
plogs.AddHook('onPocketItemAdded', function(pl, ent)
plogs.PlayerLog(pl, 'Pocket', pl:NameID() .. ' pocketed ' .. ent:GetClass(), {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end)
timer.Simple(0, function()
DarkRP.log = function() end
end)

View File

@@ -0,0 +1,32 @@
plogs.Register('Hits', true, Color(51, 128, 255))
plogs.AddHook('hhh_hitRequested', function(hitData)
if (hitData ~= nil) then
plogs.PlayerLog(hitData.requester, 'Hits', hitData.requester:NameID() .. ' requested a hit on ' .. hitData.target:NameID() .. ' for $' .. hitData.reward, {
['Requester Name'] = hitData.requester:Name(),
['Requester SteamID'] = hitData.requester:SteamID(),
['Target Name'] = hitData.target:Name(),
['Target SteamID'] = hitData.target:SteamID(),
})
end
end)
plogs.AddHook('hhh_hitAborted', function(hitData)
if (hitData ~= nil) then
plogs.PlayerLog(hitData.hitman, 'Hits', hitData.hitman:NameID() .. ' aborted a hit on ' .. hitData.target:NameID(), {
['Hitman Name'] = hitData.hitman:Name(),
['Hitman SteamID'] = hitData.hitman:SteamID(),
['Target Name'] = hitData.target:Name(),
['Target SteamID'] = hitData.target:SteamID(),
})
end
end)
plogs.AddHook('hhh_hitFinished', function(hitman, target)
plogs.PlayerLog(hitman, 'Hits', hitman:NameID() .. ' completed a hit on ' .. target:NameID(), {
['Hitman Name'] = hitman:Name(),
['Hitman SteamID'] = hitman:SteamID(),
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
})
end)

View File

@@ -0,0 +1,19 @@
plogs.Register('Hits', true, Color(51, 128, 255))
plogs.AddHook('HMHitAccepted', function(hitman, target, amount)
plogs.PlayerLog(hitman, 'Hits', hitman:NameID() .. ' accepted a hit on ' .. target:NameID() .. ' for $' .. amount, {
['Hitman Name'] = hitman:Name(),
['Hitman SteamID'] = hitman:SteamID(),
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
})
end)
plogs.AddHook('HMHitComplete', function(hitman, target)
plogs.PlayerLog(hitman, 'Hits', hitman:NameID() .. ' completed a hit on ' .. target:NameID(), {
['Hitman Name'] = hitman:Name(),
['Hitman SteamID'] = hitman:SteamID(),
['Target Name'] = target:Name(),
['Target SteamID'] = target:SteamID(),
})
end)

View File

@@ -0,0 +1,59 @@
plogs.Register('Kills', true, Color(255,0,0))
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
plogs.PlayerLog(pl, 'Kills', attacker .. ' killed ' .. 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)

View File

@@ -0,0 +1,8 @@
plogs.Register('LAC', true, Color(204,0,153))
plogs.AddHook('LAC.OnDetect', function(pl, logstr, reason)
plogs.PlayerLog(pl, 'LAC', pl:NameID() .. ' has been detected for ' .. reason, {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end)

View File

@@ -0,0 +1,21 @@
plogs.Register('Maestro', false)
local function concat(t)
local s = ''
for k, v in pairs(t) do
if (not istable(v)) then
s = s .. tostring(v)
else
s = s .. concat(v)
end
end
end
plogs.AddHook('maestro_command', function(pl, cmd, args)
if pl:IsPlayer() then
plogs.PlayerLog(pl, 'Maestro', pl:NameID() .. ' has ran command "' .. cmd .. '" with args "' .. concat(args, ' ') .. '"', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID(),
})
end
end)

View File

@@ -0,0 +1,15 @@
plogs.Register('NLR', true, Color(255,100,0))
plogs.AddHook('NLR', 'PlayerEnteredNlrZone', function(t, pl)
plogs.PlayerLogg(pl, 'NLR', pl:NameID() .. ' entered an NLR zone', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID(),
})
end)
plogs.AddHook('NLR', 'PlayerExitedNlrZone', function(t, pl, time)
plogs.PlayerLog(pl, 'NLR', pl:NameID() .. ' left an NLR zone', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID(),
})
end)

View File

@@ -0,0 +1,8 @@
plogs.Register('Props', true, Color(50,175,255))
plogs.AddHook('PlayerSpawnProp', function(pl, mdl)
plogs.PlayerLog(pl, 'Props', pl:NameID() .. ' spawned ' .. mdl, {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end)

View File

@@ -0,0 +1,10 @@
plogs.Register('Tools', false)
plogs.AddHook('CanTool', function(pl, trace, tool) -- Shame there isn't a better hook
if (not plogs.cfg.ToolBlacklist[tool]) then
plogs.PlayerLog(pl, 'Tools', pl:NameID() .. ' attempted to use tool ' .. tool, {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID()
})
end
end)

View File

@@ -0,0 +1,10 @@
plogs.Register('ULX', false)
plogs.AddHook(ULib.HOOK_COMMAND_CALLED, function(pl, cmd, args)
if pl:IsPlayer() then
plogs.PlayerLog(pl, 'ULX', pl:NameID() .. ' has ran command "' .. cmd .. '" with args "' .. table.concat(args, ' ') .. '"', {
['Name'] = pl:Name(),
['SteamID'] = pl:SteamID(),
})
end
end)