# Server exports

> Server exports for giving, checking and taking back rod skins, giving treasure maps, and starting and ending hot zones in Skeexs Fishing.

Documentation for [Skeexs Fishing](https://www.skeexs.dev/products/fishing.md), a FiveM script by Skeexs Resources. Updated 2026-11-16.

Call these exports from your own server scripts to give and take rod skins, give treasure maps, and start and end hot zones. They run on the server only. `source` is the player's server id. If you renamed the resource folder, write its new name in place of `skeexs-fishing`.

### `GrantRodSkin`

Gives a player's character a rod skin as found. The skin stays theirs at any level until you take it back. It can give any skin, including the skins no level unlocks (`diamond`, `darkmatter` and `darkmatterred` in the default config). Use it to hand out skins from your own rewards, shops or events.

| Name | Type | Description |
| --- | --- | --- |
| source | number | Server id of the player. The player must have a character loaded. |
| skinId | string | The skin's `id` in `Config.RodSkins` (`src/config/rods.lua`), such as `diamond`. A rod tint is not a skin and is refused. |

**Returns:** `boolean` ok. On failure, also a `string` reason: `"unknown"` (no skin with that id, or the player has no character) or `"owned"` (the character already found it).

```lua
local ok, reason = exports['skeexs-fishing']:GrantRodSkin(source, 'diamond')
if not ok then
    print(('Rod skin not given: %s'):format(reason))
end
```

### `RevokeRodSkin`

Takes back a skin the character found. A skin the player's level unlocks stays theirs. A rod that wore the skin goes back to Standard, and the rod in the player's hand changes with it.

| Name | Type | Description |
| --- | --- | --- |
| source | number | Server id of the player. |
| skinId | string | The skin's `id` in `Config.RodSkins`. |

**Returns:** `boolean` ok. On failure, also a `string` reason: `"unknown"` (the player has no character, or `skinId` is not a string) or `"missing"` (the character never found this skin).

```lua
exports['skeexs-fishing']:RevokeRodSkin(source, 'diamond')
```

### `HasRodSkin`

Tells whether a player owns a skin, from their level or because they found it.

| Name | Type | Description |
| --- | --- | --- |
| source | number | Server id of the player. |
| skinId | string | The skin's `id` in `Config.RodSkins`. |

**Returns:** `boolean`. `false` for an unknown skin id or a rod tint.

```lua
if exports['skeexs-fishing']:HasRodSkin(source, 'gold') then
    -- the player owns the Gold skin
end
```

### `GiveTreasureMap`

Puts a new treasure map in the player's inventory. Each map leads to its own chest on one of the treasure beaches.

| Name | Type | Description |
| --- | --- | --- |
| source | number | Server id of the player. |
| kindId | string or nil | The kind of map: `worn`, `old` or `legendary` in the default config (`Config.Treasure.maps` in `src/config/treasure.lua`). Leave it out to draw a kind by weight, as a landed fish does. |

**Returns:** `boolean`. `true` when the map is in the player's inventory. `false` when treasure is off (`Config.Treasure.enabled = false`), the map item is not in the inventory's item list, `kindId` is not a known kind, or the inventory refuses the item.

```lua
exports['skeexs-fishing']:GiveTreasureMap(source, 'legendary')
```

### `StartHotZone`

Starts a hot zone: a circle of water where the fish bite more for a while. Call it with nothing to start one where a random hot zone would come up. Call it with a table to start the circle the table describes. At most 8 hot zones run at once.

| Name | Type | Description |
| --- | --- | --- |
| spec | table or nil | Leave it out for a random zone. Otherwise the circle, with the fields below. |

| Field | Type | Description |
| --- | --- | --- |
| x | number | World X of the centre. |
| y | number | World Y of the centre. |
| radius | number | Radius in metres, from 20 to 500. |
| minutes | integer or nil | How long the zone lasts, from 1 to 720 minutes. Leave it out for the middle of the random zones' range. |
| species | string or nil | A fish id, such as `mackerel`, to make the zone a run of that fish. The fish must live in that water. |
| label | string or nil | Your own name for the place. Without it, the zone takes the fishing spot's name. |

**Returns:**

- Without `spec`: `true` once a place is found (the zone begins within a few seconds), or `nil` and a reason.
- With `spec`: the new zone's id as a `string`, such as `h1763251200-3`, or `nil` and a reason.

The reasons are locale keys, and `locales/` holds the text for each: `"hot_off"` (hot zones are off in `Config.HotZones`), `"hot_full"` (8 zones already run), `"hot_no_site"` (no fishing zone has room for a random zone), `"hot_bad_draft"` (`spec` is not a table, or `x`, `y` or `radius` is not a number), `"hot_radius"`, `"hot_minutes"`, `"hot_species_unknown"`, `"hot_species_water"` (that fish does not live in this water) and `"hot_closed_water"` (nobody may fish this water).

```lua
local id, reason = exports['skeexs-fishing']:StartHotZone({
    x = -1850.0, y = -1250.0, radius = 120, minutes = 30, species = 'mackerel', label = 'Del Perro Pier',
})
if not id then
    print(('No hot zone: %s'):format(reason))
end
```

### `StopHotZones`

Ends one hot zone by its id, or every hot zone when you pass no id. It ends random zones and zones an admin drew too.

| Name | Type | Description |
| --- | --- | --- |
| id | string or nil | The id `StartHotZone` returned. Leave it out to end every zone. |

**Returns:** `integer`, the number of zones it ended. For an id that is `1`, or `0` when no zone has that id.

```lua
exports['skeexs-fishing']:StopHotZones(id) -- ends one zone
exports['skeexs-fishing']:StopHotZones()   -- ends every zone
```
