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)
| Field | Type | Description |
|---|---|---|
data.reportId | number | The new report ID |
data.playerId | string | Reporter's framework identifier |
data.playerName | string | Reporter's character name |
data.title | string | Report title |
data.typeId | number | Report type ID |
data.priority | string | Report 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)
| Field | Type | Description |
|---|---|---|
data.reportId | number | The report ID |
data.adminId | string | Admin's framework identifier |
data.adminName | string | Admin'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)
| Field | Type | Description |
|---|---|---|
data.reportId | number | The report ID |
data.oldStatus | string | Previous status |
data.newStatus | string | New status |
data.changedById | string | Identifier of the admin who changed the status |
data.changedByName | string | Name 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)
| Field | Type | Description |
|---|---|---|
data.reportId | number | The report ID |
data.adminId | string | Admin's framework identifier |
data.adminName | string | Admin'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)
| Field | Type | Description |
|---|---|---|
data.reportId | number | The report ID |
data.senderId | string | Sender's framework identifier |
data.senderName | string | Sender's character name |
data.isAdmin | boolean | Whether the sender is an admin |
data.message | string | The message content |