Koja Scripts

Installation

Install Koja Fishing: requirements, database, inventory items and PNG icons for ox_inventory, QBCore and ESX, start order, permissions and updating from 1.1.0.

Installation

Koja Fishing is a complete fishing system for FiveM: a skill-based reeling minigame, a guided tutorial, fishing spots with boosted zones, a dynamic-price shop, quests, a skill tree, tournaments with automatic prize payouts, a fishing licence exam, boat rental, diving and digging contracts, fishing parties, poaching fines and illegal electric fishing. This page takes you from a fresh download to a working resource, and explains how to update from 1.1.0.

Requirements

ResourceWhy it is needed
koja-libFramework bridge (ESX / QBCore / ox_core), inventory, money, jobs, callbacks, progress bars and notifications.
oxmysqlDatabase access.
ox_targetInteraction with peds, boats, placed batteries and the police "Inspect catch" option.
ESX, QBCore or ox_coreAny framework supported by koja-lib.
ox_inventory, qb-inventory or the ESX inventoryItems are read and given through koja-lib.

Optional, only for poaching fines:

ResourceWhen
esx_billingConfig.Poaching.Billing = 'esx_billing' — fines are inserted into its billing table.
esx_addonaccountConfig.Poaching.Billing = 'money' — the fine is paid into Config.Poaching.Society when the resource is started.
  1. Copy the resource

    Put the koja-fishing folder in your resources directory, next to koja-lib.
  2. Import the database

    Import install.sql into your database. With Config.CreateAutoTable = true (the default) the resource also creates every missing table and column on start, so this step is optional on a fresh install.
    TableContent
    koja-fishing-playerdataLevel, XP, licence, exam attempts, skills, guide and digging tutorial flags, unlocks.
    koja-fishing-reedemcodes, koja-fishing-redeemcode-usesRedeem codes and who used them.
    koja-fishing-quest-progress, koja-fishing-quest-followQuest progress and the followed board.
    koja-fishing-tournament-participants, koja-fishing-tournament-results, koja-fishing-tournament-rewardsTournament scores, settled tournaments and prizes waiting for offline winners.
    koja-fishing-configValues changed in the admin panel.
    koja-fishing-divingScuba gear levels, air, stats and diving contracts.
    koja-fishing-diggingShovel, detector and bag levels, stats and digging contracts.
  3. Register the items

    The script gives and removes real inventory items, so every item from shared/config.items.lua and every fish from shared/config.fish.lua must exist in your inventory. Ready-made definitions for all of them are in the install/ folder:
    InventoryDefinitionsIcons
    ox_inventoryinstall/ox_inventory_items.lua → paste into ox_inventory/data/items.luainstall/inventory_images/*.png → ox_inventory/web/images/
    qb-inventoryinstall/qb_items.lua → paste into qb-core/shared/items.luaweb/public/images/items/*.webp → qb-inventory/html/images/
    ESX defaultinstall/esx_items.sql → import into the items tableDepends on your inventory.
    File names already match the item names.
  4. Start order

    Add the resources to server.cfg in this order:
    server.cfg
    ensure oxmysql
    ensure ox_target
    ensure koja-lib
    ensure koja-fishing
  5. Grant admin permissions

    The admin panel (/fishingadmin) opens for players with the koja-fishing.admin ACE or a framework group listed in Config.Admin.Groups.
    server.cfg
    add_ace group.admin koja-fishing.admin allow
    See Commands for every command and its permission.
  6. Set your police jobs

    Poaching inspections and fines are available to the jobs in Config.Poaching.PoliceJobs (default police and sheriff). Pick how fines are paid with Config.Poaching.Billing — see Configuration.
  7. Check the release settings

    Before going live, open shared/config.main.lua and make sure Config.Debug = false. Debug mode enables test commands that place free batteries and open test UIs.

Updating from 1.1.0

1.2.0 changes the way players fish, adds five config files and new items. Back up your database and your shared/ folder first.

  1. Replace the files

    Replace every file, including fxmanifest.lua — it loads the new config files. Koja Fishing no longer needs ox_lib; keep it in server.cfg only if other resources use it. Take the new locales/*.json (1.2.0 adds many keys) and re-apply your own text changes. Keep your edited configs aside and merge them in the next step.
  2. Merge your configs

    The new files config.minigame.lua, config.tutorial.lua, config.admin.lua, config.poaching.lua and config.party.lua work as shipped. In the files you edited, add the new options:
    • config.main.lua — Config.FishingDui is gone; the indicator is set with Config.Minigame.DuiHeight and DuiSize. Config.Locale now defaults to en.
    • config.hotbar.lua — the hotbar command is now kf_hotbar_open on Q (was fishinghotbar on F6). An old file keeps the old command.
    • config.items.lua — requiredLevel on equipment, and the new items listed below.
    • config.fish.lua — protected on the four swamp species, and the new fish.
    • config.spots.lua — requireLicense, minRodTier, unlockFlag, protected, blip.minLevel and the new spots.
    • config.peds.lua — new peds (kuba, marek, stefan, hank, tom, gustaw), second zones on Chumash Pier, scenario, shop multipliers, info and hermit blocks.
    • config.quests.lua — independent boards and money / items rewards.
    • config.test.lua — Lessons.
    • config.boatrent.lua — AnchorKey and the Chumash Pier parking spots.
    • config.diving.lua — Gear, Tutorial and Contracts.
    • config.digging.lua — Intro, Bike, Gear, Contracts and the treasure Drops.
  3. Add the new items

    Register these items in your inventory (definitions in install/) and copy their icons: fishpedia, swamp_catfish, bowfin, swamp_eel, alligator_gar, mackerel, cod, sea_bream, flounder, pearl, ancient_coin, sunken_compass, ship_bell, pirate_doubloon, rusty_key, fossil_shell, amber_chunk. On ox_inventory copy all of install/inventory_images/ — every icon now ships as PNG.
  4. Update the database

    With Config.CreateAutoTable = true nothing is needed: the new tables and columns are created on start. Otherwise create the new tables from install.sql and add the new columns yourself:
    update-1.2.0.sql
    ALTER TABLE `koja-fishing-playerdata`
        ADD COLUMN `tutorial_done` TINYINT(1) NOT NULL DEFAULT 0,
        ADD COLUMN `tutorial_kit` TINYINT(1) NOT NULL DEFAULT 0,
        ADD COLUMN `digging_intro` TINYINT(1) NOT NULL DEFAULT 0,
        ADD COLUMN `digging_kit` TINYINT(1) NOT NULL DEFAULT 0,
        ADD COLUMN `unlocks` LONGTEXT NULL;
  5. Tell your players

    There is no /fishing command any more. Players cast with E when the prompt appears on a fishing spot and stop with X. The hotbar opens with Q and the party window with F7.

Troubleshooting

SymptomCause
Peds do not appearox_target is not started, or koja-fishing starts before koja-lib.
No cast prompt on a spotThe player is not facing water, is moving, swimming or in a non-boat vehicle.
"Missing item" when starting to fishThe item is missing from your inventory's item list, or nothing is equipped in the hotbar.
Shop, exam or tournament says the request failedYou are standing more than Config.Security.PedInteractDistance metres from the ped.
Paying by bank fails on ox_corekoja-lib supports only cash on ox_core. Use cash, or set EntryMoneyType = 'cash' for tournaments.
Item icons missing in ox_inventory.webp files were copied. Copy the PNG files from install/inventory_images/.
Item icons missing in the UIThe bundled UI in web/build was not uploaded. Never delete web/build.
/fishingadmin says no permissionThe player has neither the koja-fishing.admin ACE nor a group from Config.Admin.Groups.
Police do not see "Inspect catch"The job is not in Config.Poaching.PoliceJobs, the grade is below MinPoliceGrade, or RequireOnDuty is on and the officer is off duty.
A config edit has no effectThe value was changed in the admin panel. Panel values override the file — reset it to default in the panel.