Ocean Solutions
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.

ensure oxmysql
ensure ocean-core
ensure kill-messages

Exports

givePlayerAccess

Grants a player permission to use the Kill Messages system.

Usage:

exports['kill-messages']:givePlayerAccess(playerId)
ParameterTypeDescription
playerIdnumberThe server ID of the player

Events

Server Events

ocean_killmessages:changeKillMessage

Triggered when a player saves a new kill message via the UI.

RegisterNetEvent('ocean_killmessages:changeKillMessage', function(message)
    -- message = string entered by player
end)

Client Events

ocean_killmessages:showKillMessage

Shows a kill notification to a player.

TriggerClientEvent('ocean_killmessages:showKillMessage', playerId, {
    type = 'killMessage',
    title = 'ELIMINATED',
    message = 'Custom player message'
})
FieldTypeDescription
typestringShould be 'killMessage'
titlestringNotification title
messagestringCustom kill message text

ocean_killmessages:showKillChange

Opens the UI for a player to change their kill message.

TriggerClientEvent('ocean_killmessages:showKillChange', playerId, {
    type = 'setup',
    title = 'SETUP KILL MESSAGE',
    defaultMessage = 'Ocean Solutions'
})
FieldTypeDescription
typestring'setup' for UI
titlestringTitle displayed in the UI
defaultMessagestringPre-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

local playerId = source
exports['ocean_killmessages']:givePlayerAccess(playerId)

Database Reference (for developers)

The resource uses a table called ocean_killmessages:

ColumnTypeDescription
player_identifierVARCHAR(60)Player identifier (ESX/QB)
killMessageVARCHAR(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.

On this page