Combat Log Detector
Commands, Exports & Events
Every command, export and event of Combat Log Detector, with what to pass, what you get back and an example.
Everything other resources can use to work with Combat Log Detector: chat commands, exports you can call from your own scripts, and events you can listen to or trigger.
Commands
/combatlogtest
Creates a test panel at your position so you can see how it looks. The name is Config.TestCommand.Name.
Arguments
None.
Who can use it
Admins
Server exports
GetDrops
Lists the panels that are showing right now (players who left recently).
What you pass
Nothing.
What you get back
dropstable[]Each has
id,coords(x, y, z),serverId,name,identifier,leftAt(time text),reasonandhasAvatar.
Example
for _, drop in ipairs(exports.lg_combatlog:GetDrops()) do
print(drop.name, drop.reason, drop.leftAt)
endCreateDrop
Creates a panel at a player's current position, as if they had just left.
What you pass
sourcenumberThe player's server id.
reasonstringoptionalText shown on the panel. Defaults to "Unknown".
secondsnumberoptionalHow long it stays. Defaults to
Config.DropTTL.
What you get back
dropIdnumber | nilId of the new panel, or
nilif the player has no ped.
Example
local id = exports.lg_combatlog:CreateDrop(source, 'Manual', 120)RemoveDrop
Removes one panel.
What you pass
dropIdnumberId from
CreateDroporGetDrops.
What you get back
removedbooleanfalsewhen no panel has that id.
Example
exports.lg_combatlog:RemoveDrop(id)ClearDrops
Removes every panel.
What you pass
Nothing.
What you get back
Nothing.
Example
exports.lg_combatlog:ClearDrops()Client exports
GetDrops
The panels this player currently knows about.
What you pass
Nothing.
What you get back
dropstable[]Same fields as the server export.
Events
lg_combatlog:server:dropCreated
Fired for every new panel, e.g. to send it to your own logs.
What you receive
droptableSame fields as an entry of
GetDrops.
Example
AddEventHandler('lg_combatlog:server:dropCreated', function(drop)
print(('%s left: %s'):format(drop.name, drop.reason))
end)lg_combatlog:client:setDrops
Sent by the server to every player whenever the list of panels changes.
What you receive
dropstable[]The full current list.
Last updated