Scripts
Kill Messages
This page provides all the integration details for developers using the locked killmessages resource.
Since the script is locked, only the exports, events, and how to use them are documented.
Dependencies
- oxmysql
- ocean-core
Ensure these resources are loaded before Kill Messages.
Exports
givePlayerAccess
Grants a player permission to use the Kill Messages system.
Usage:
| Parameter | Type | Description |
|---|---|---|
| playerId | number | The server ID of the player |
Events
Server Events
ocean_killmessages:changeKillMessage
Triggered when a player saves a new kill message via the UI.
Client Events
ocean_killmessages:showKillMessage
Shows a kill notification to a player.
| Field | Type | Description |
|---|---|---|
| type | string | Should be 'killMessage' |
| title | string | Notification title |
| message | string | Custom kill message text |
ocean_killmessages:showKillChange
Opens the UI for a player to change their kill message.
| Field | Type | Description |
|---|---|---|
| type | string | 'setup' for UI |
| title | string | Title displayed in the UI |
| defaultMessage | string | Pre-filled default message |
Integration Notes
- The script caches messages on resource start; updates are handled automatically when the player changes their message.
- Use the exports to grant access programmatically from other scripts or automated systems.
- Framework-independent: Works with ESX, QBCore, or any custom framework that can trigger server events and client events.
Example: Giving Access via Another Script
Database Reference (for developers)
The resource uses a table called ocean_killmessages:
| Column | Type | Description |
|---|---|---|
| player_identifier | VARCHAR(60) | Player identifier (ESX/QB) |
| killMessage | VARCHAR(255) | Player’s custom kill message |
The table is managed internally; you should not modify it manually unless necessary.
Summary
- Use exports to give access.
- Listen to events for integration.
- The script handles caching and database updates automatically.
- Fully compatible with any framework supported by Ocean Core and oxmysql.