Customization
Framework hooks and localization for ktx_fishing.
Customization
ktx_fishing ships with ESX support out of the box. Adapt it to any framework by editing the files in custom/.
Server Hooks
custom/server.lua contains four exports that handle framework-specific logic.
getPlayerIdentifier
Returns the player's unique identifier from the framework.
function getPlayerIdentifier(source)
local xPlayer = ESX.GetPlayerFromId(source)
if not xPlayer then return nil end
return xPlayer.getIdentifier()
endFor QBx/QB-Core, replace with Player.PlayerData.citizenid or equivalent.
playerHasItem
Checks if the player has a specific item in their inventory.
function playerHasItem(source, itemName)
local xPlayer = ESX.GetPlayerFromId(source)
if not xPlayer then return false end
local item = xPlayer.getInventoryItem(itemName)
return item and item.count > 0
endcanPlayerReceiveItem
Checks if the player has inventory space for the reward.
function canPlayerReceiveItem(source, itemName, amount)
local xPlayer = ESX.GetPlayerFromId(source)
if not xPlayer then return false end
return xPlayer.canCarryItem(itemName, amount)
endaddItemToPlayer
Gives an item to the player.
function addItemToPlayer(source, itemName, amount)
local xPlayer = ESX.GetPlayerFromId(source)
if not xPlayer then return false end
xPlayer.addInventoryItem(itemName, amount)
return true
endClient Hooks
custom/client.lua contains notification handlers.
showNotification
Standard notification shown to the player.
function showNotification(message, type, title, duration)
ESX.ShowNotification(message, type, duration, title)
endmessage- notification texttype-"success","error","info", or a custom string your framework supportstitle- optional title shown above the messageduration- display time in milliseconds
showHelpNotification
Contextual help text shown near interaction points.
function showHelpNotification(key, message)
ESX.ShowHelpNotification(message)
endkey- a stable identifier for the prompt (lets your framework dedupe repeated prompts)message- the help text to display
Localization
Translation files live in locales/. The resource ships with en.json and de.json.
To add a new language:
- Copy
locales/en.jsontolocales/{code}.json(e.g.fr.json) - Translate all string values
- Set
"Locale": { "language": "fr" }instatic/config.json
Keys must stay the same. Only translate the values.