Skip to content

Installation ​

This guide will walk you through installing prp-farming on your FiveM server.

Installation steps

1
Download the resources
Download both prp-farming and prp-farming-assets from the CFX portal and place them in your resources folder.
2
Optional: open world farming
Download prp-scanner and prp-scanner-assets from the CFX portal to use open world farming.
3
Add to server.cfg
Add both resources to your server.cfg after all dependencies, with the assets resource before the main script.
ensure ox_lib
ensure prp-bridge
ensure prp-scanner-assets
ensure prp-scanner
ensure prp-farming-assets
ensure prp-farming
4
Database
The farming_health and farming_pots tables are created automatically on first run.
5
Add items
Add the required items to your inventory resource — see Items below.
6
Configure shared/config.lua
Open shared/config.lua to configure the job, activities and farm health settings.
7
Configure server/config.lua
Open server/config.lua to configure the seeds shop and webhook logging.
8
Optional: disable open world
Set Config.OWState = false in shared/config_openworld.lua to disable open world farming.
9
Optional: inventory icons
Custom inventory icons are included in the installation/inventory icons folder. Copy them to your inventory resource's image directory if you'd like to use them.

Items ​

Add all required items to your inventory resource using the format appropriate for your setup.

Add items listed below to your ox_inventory into data/items.lua.

lua
-- Pots
["farm_pot_small"] = {
    label = "Small Pot",
    weight = 500
},
["farm_pot_medium"] = {
    label = "Medium Pot",
    weight = 750
},
["farm_pot_large"] = {
    label = "Large Pot",
    weight = 1000
},

-- Tools
["farm_water_can"] = {
    label = "Watering Can",
    weight = 300
},
["farm_fertilizer"] = {
    label = "Fertilizer",
    weight = 200,
},

-- Seeds
["seeds_lettuce"] = {
    label = "Lettuce Seeds",
    weight = 50
},
["seeds_tomato"] = {
    label = "Tomato Seeds",
    weight = 50
},
["seeds_strawberry"] = {
    label = "Strawberry Seeds",
    weight = 50
},
["seeds_grape"] = {
    label = "Grape Seeds",
    weight = 50
},
["seeds_cucumber"] = {
    label = "Cucumber Seeds",
    weight = 50
},
["seeds_eggplant"] = {
    label = "Eggplant Seeds",
    weight = 50
},
["seeds_onion"] = {
    label = "Onion Seeds",
    weight = 50
},
["seeds_potato"] = {
    label = "Potato Seeds",
    weight = 50
},
["seeds_watermelon"] = {
    label = "Watermelon Seeds",
    weight = 50
},
["seeds_banana"] = {
    label = "Banana Seeds",
    weight = 50
},
["seeds_apple"] = {
    label = "Apple Seeds",
    weight = 50
},
["seeds_wheat"] = {
    label = "Wheat Seeds",
    weight = 50
},
["seeds_soy"] = {
    label = "Soy Seeds",
    weight = 50
},

-- Crops
["farm_lettuce"] = {
    label = "Organic Lettuce",
    weight = 200,
},
["farm_tomato"] = {
    label = "Organic Tomato",
    weight = 200,
},
["farm_strawberry"] = {
    label = "Organic Strawberry",
    weight = 200,
},
["farm_grape"] = {
    label = "Organic Grape",
    weight = 200,
},
["farm_cucumber"] = {
    label = "Organic Cucumber",
    weight = 200,
},
["farm_eggplant"] = {
    label = "Organic Eggplant",
    weight = 200,
},
["farm_onion"] = {
    label = "Organic Onion",
    weight = 200,
},
["farm_potato"] = {
    label = "Organic Potato",
    weight = 200,
},
["farm_watermelon"] = {
    label = "Organic Watermelon",
    weight = 200,
},
["farm_banana"] = {
    label = "Organic Banana",
    weight = 200,
},
["farm_apple"] = {
    label = "Organic Apple",
    weight = 200,
},
["farm_wheat"] = {
    label = "Organic Wheat",
    weight = 200,
},
["farm_soy"] = {
    label = "Organic Soy Bean",
    weight = 200,
},

Database ​

The resource creates the following tables automatically:

sql
CREATE TABLE IF NOT EXISTS `farming_health` (
    `sectorName` varchar(50) NOT NULL,
    `health` int(11) DEFAULT 0,
    `lastUpdated` int(11) DEFAULT NULL,
    PRIMARY KEY (`sectorName`)
);

CREATE TABLE IF NOT EXISTS `farming_pots` (
    `id`             int(11) NOT NULL AUTO_INCREMENT,
    `stateId`        varchar(255) NOT NULL,
    `potName`        varchar(64) NOT NULL,
    `pos`            longtext NOT NULL,
    `locationId`     int(11) NOT NULL,
    `crops`          longtext DEFAULT NULL,
    `lastWatered`    bigint(20) DEFAULT NULL,
    `lastFertilized` bigint(20) DEFAULT NULL,
    PRIMARY KEY (`id`)
);