Store

Integration

Events and integration guide for legacy-reports

Legacy Reports is a self-contained resource with no external exports. All report management is handled through the in-game UI. However, the resource emits server events that other scripts can listen to for logging, integrations, or custom behavior.

Server Events#

legacy-reports:reportCreated#

Fires when a player submits a new report.

AddEventHandler('legacy-reports:reportCreated', function(data)
    print(('Report #%d created by %s: %s'):format(
        data.reportId, data.playerName, data.title
    ))
end)
FieldTypeDescription
data.reportIdnumberThe new report ID
data.playerIdstringReporter's framework identifier
data.playerNamestringReporter's character name
data.titlestringReport title
data.typeIdnumberReport type ID
data.prioritystringReport priority ('low', 'medium', 'high', 'critical')

legacy-reports:reportClaimed#

Fires when an admin claims a report.

AddEventHandler('legacy-reports:reportClaimed', function(data)
    print(('Report #%d claimed by %s'):format(
        data.reportId, data.adminName
    ))
end)
FieldTypeDescription
data.reportIdnumberThe report ID
data.adminIdstringAdmin's framework identifier
data.adminNamestringAdmin's character name

legacy-reports:reportStatusChanged#

Fires when a report's status is changed.

AddEventHandler('legacy-reports:reportStatusChanged', function(data)
    print(('Report #%d status changed from %s to %s by %s'):format(
        data.reportId, data.oldStatus, data.newStatus, data.changedByName
    ))
end)
FieldTypeDescription
data.reportIdnumberThe report ID
data.oldStatusstringPrevious status
data.newStatusstringNew status
data.changedByIdstringIdentifier of the admin who changed the status
data.changedByNamestringName of the admin who changed the status

legacy-reports:reportDeleted#

Fires when an admin deletes a report.

AddEventHandler('legacy-reports:reportDeleted', function(data)
    print(('Report #%d deleted by %s'):format(
        data.reportId, data.adminName
    ))
end)
FieldTypeDescription
data.reportIdnumberThe report ID
data.adminIdstringAdmin's framework identifier
data.adminNamestringAdmin's character name

legacy-reports:messageSent#

Fires when a message is sent in a report's chat (by either a player or admin).

AddEventHandler('legacy-reports:messageSent', function(data)
    print(('Message in report #%d from %s: %s'):format(
        data.reportId, data.senderName, data.message
    ))
end)
FieldTypeDescription
data.reportIdnumberThe report ID
data.senderIdstringSender's framework identifier
data.senderNamestringSender's character name
data.isAdminbooleanWhether the sender is an admin
data.messagestringThe message content