๐Ÿง‘โ€๐ŸŒพPlantation System

A comprehensive farming and plantation system for FiveM servers with sprinkler mechanics.

Features

  • Plant various crops (tomatoes, zucchini, pumpkins, potatoes, peppers)

  • Three-stage growth system

  • Water and fertilizer management

  • Automated sprinkler system

  • Plant decay system

  • Rotting mechanics

  • Multi-language support

  • Framework agnostic (supports ESX and QB-Core)

Dependencies

Required:

  • oxmysql

  • One of the supported frameworks:

    • ESX

    • QB-Core

Optional:

  • ox_target or qb-target for targeting system

  • One of the supported inventory systems:

    • ox_inventory

    • core_inventory

    • codem-inventory

    • qb-inventory

Installation

  1. Import the SQL file to your database:

hate-plantation/database.sql
  1. Add to your server.cfg:

ensure hate-plantation
  1. Configure the script in config.lua:

  • Set your preferred language

  • Adjust growth rates and timers

  • Configure valid planting areas

  • Customize rewards

  • Set up sprinkler settings

Configuration

The script can be configured through config.lua:

  • Language settings

  • Plant types and growth stages

  • Water and fertilizer items

  • Sprinkler settings

  • Framework detection

  • Inventory system detection

  • Target system detection

Supported Languages

  • English (en)

  • Turkish (tr)

Add more languages by extending the Config.Languages table in config.lua.

Items Required

Seeds:

  • tomato_seed

  • zucchini_seed

  • pumpkin_seed

  • potato_seed

  • pepper_seed

Water Items:

  • drink_water

  • watering_can

Fertilizer Items:

  • fertilizer

  • super_fertilizer

Sprinkler Items:

  • Installation item (configurable)

  • Repair item (configurable)

  • Water refill items (configurable)

Technical Details

The script uses:

  • Database for persistent storage

  • Framework-agnostic design

  • Configurable targeting system

  • Progressive growth system

  • Automated maintenance systems

Support

For support or bug reports, please contact through the marketplace where you purchased the script.

Note: This script uses FiveM's escrow system for protection. Client and server-side code is encrypted.

Detailed Configuration Guide

Basic Settings

Config.DebugMode = false        -- Enable/disable debug mode
Config.UseMarker = false        -- Enable/disable marker visualization
Config.DrawDistance = 15.0      -- Object rendering distance
Config.Locale = 'en'            -- Default language setting

Plant Decay System

Config.PlantDecay = {
    waterThreshold = 0,         -- Minimum water level before decay starts
    fertilizerThreshold = 0,    -- Minimum fertilizer level before decay starts
    decayTime = 2              -- Minutes until neglected plants are deleted
}

Sprinkler System Configuration

Config.Sprinkler = {
    object = 'prop_mb_hanger_sprinkler',  -- Sprinkler model
    waterRadius = 5.0,                    -- Water coverage radius in meters
    waterInterval = 30,                   -- Watering frequency in seconds
    waterAmount = 10,                     -- Water amount per spray
    particleDict = "core",                -- Particle effect dictionary
    particleName = "ent_amb_sprinkler_golf", -- Particle effect name
    particleScale = 0.5,                  -- Effect size
    maxDurability = 100,                  -- Maximum durability
    durabilityLoss = 1,                   -- Durability loss per use
    removeAfterBreak = true,              -- Auto-remove when broken
    breakDurability = 0,                  -- Break threshold
    repairItem = 'screwdriver',           -- Required repair item
    installItem = 'mushroom',             -- Required installation item
    maxPlacementDistance = 10.0,          -- Maximum placement distance
    maxWaterCapacity = 1000,              -- Maximum water capacity
    waterUsagePerSpray = 10,              -- Water usage per spray
    maxInteractionDistance = 2.0,         -- Maximum interaction distance
    isActive = false,                     -- Initial state
    waterRefillItems = {                  -- Water refill items
        ['drink_water'] = { value = 100, label = 'Water Bottle' },
        ['drink_kvas'] = { value = 250, label = 'Water Bucket' },
        ['water_tank'] = { value = 500, label = 'Water Tank' }
    }
}

Plant Configuration Structure

Each plant type follows this structure:

Config.PlantableItems = {
    ['seed_name'] = {
        label = 'Plant Name',
        baseObject = 'prop_model',
        stages = {
            [1] = { -- Stage 1
                attachments = {},         -- Stage 1 attachments
                minZ = -1.5,              -- Minimum Z position
                maxZ = -0.3               -- Maximum Z position
            },
            [2] = { -- Stage 2
                attachments = {
                    {
                        model = 'model_name',
                        positions = {
                            {pos = vector3(x, y, z), rot = vector3(x, y, z)}
                        }
                    }
                },
                minZ = -1.4,
                maxZ = -0.2
            },
            [3] = { -- Stage 3
                attachments = {},         -- Similar to Stage 2
                minZ = -1.1,
                maxZ = 0.0
            }
        },
        growthPerMinute = 2.5,           -- Growth rate
        waterInterval = 5,               -- Water consumption rate
        fertilizerInterval = 3,          -- Fertilizer consumption rate
        rotTime = 2,                     -- Time until rot after maturity
        rewards = {
            fresh = {                    -- Fresh harvest rewards
                [1] = {                  -- Stage 1 rewards
                    ['item'] = { min = 1, max = 1 }
                },
                [2] = {},                -- Stage 2 rewards
                [3] = {}                 -- Stage 3 rewards
            },
            rotten = {                   -- Rotten plant rewards
                ['rotten_item'] = { min = 1, max = 2 }
            }
        }
    }
}

Available Plant Types

  1. Tomato (tomato_seed)

  2. Zucchini (zucchini_seed)

  3. Pumpkin (pumpkin_seed)

  4. Potato (potato_seed)

  5. Green Pepper (pepper_seed)

Water and Fertilizer Items

Config.WaterItems = {
    ['drink_water'] = { value = 5, label = 'Water Bottle' },
    ['watering_can'] = { value = 10, label = 'Watering Can' }
}

Config.FertilizerItems = {
    ['fertilizer'] = { value = 5, label = 'Basic Fertilizer' },
    ['super_fertilizer'] = { value = 10, label = 'Super Fertilizer' }
}

Valid Ground Types

Config.ValidGroundHashes = {
    [-1286696947] = true,  -- GRASS
    [-1885547121] = true,  -- DIRT
    [223086562] = true,    -- Soil type 1
    [-461750719] = true,   -- Soil type 2
    [1109728704] = true,   -- Soil type 3
    [-1833527165] = true   -- Soil type 4
}

Progress Bar Settings

Config.ProgressBars = {
    ["fertilizer"] = {
        duration = 4000,                 -- Duration in ms
        label = 'Fertilizing',           -- Display label
        animation = {
            task = 'WORLD_HUMAN_GARDENER_PLANT'
        }
    },
    ["planting"] = {
        duration = 4000,
        label = 'Planting',
        animation = {
            task = 'WORLD_HUMAN_GARDENER_PLANT'
        }
    },
    ["water"] = {
        duration = 4500,
        label = 'Watering',
        animation = {
            animDict = 'weapons@misc@jerrycan@',
            anim = 'fire'
        }
    }
}

Framework Detection

The script automatically detects and configures:

  • Framework (ESX or QB-Core)

  • Target system (ox_target, qtarget, or qb-target)

  • Inventory system (ox_inventory, core_inventory, or codem-inventory)

Customization Tips

  1. Adjust growthPerMinute to control plant growth speed

  2. Modify waterInterval and fertilizerInterval to change resource consumption rates

  3. Customize rewards tables to adjust harvest yields

  4. Add new ground types to ValidGroundHashes for expanded planting areas

  5. Modify Config.Sprinkler settings to adjust automated watering behavior