Skip to main content

Farmer Job

Config file

config.lua
Language = "en"

Config = {}

Config.SellPed = { coords = vector3(1724.345825, 4714.210449, 41.137386), heading = 198.645218, model = `a_m_m_salton_02` }

-- plants render distance
Config.RenderDistance = 150.0

-- removed for better visiblity
Config.Clothes = {}

Config.Job = {
    name = "farmer",
    startPed = {
        coords = vector4(2016.851, 4987.842, 41.09825, 138.6163),
        model = `a_m_m_farmer_01`
    },
    label = _L("job_label"),
    maxPlayers = 6,
    changePercent = true, -- allows owner to change player percents
    description = _L("job_description"),
    requireClothes = true, -- require job clothes
    clothes = Config.Clothes,
    requireJob = false,
    vehicle = { -- or nil
        price = 500,
        model = `farson`,
        coords = vector4(2018.534, 4976.673, 40.25508, 226.8241),
        props = {
            livery = 1,
            mods = {
                [10] = -1,
            }
        }
    },
    canEndQuicker = true, -- can sell crops before harvesting all of them
    -- changes difficulty (amount of crops) depending on players on job (must be divisible by amount of fields [3 by default])
    difficulty = {
        [1] = 36,
        [2] = 36,
        [3] = 48,
        [4] = 48,
        [5] = 72,
        [6] = 72,
    },
    -- when players are not close to a owner/action coords during a action it kicks them
    playersActivityCheck = {
        closeCheck = true,
        vehDist = 250.0, -- distance from the vehicle
        noActionCheck = true, -- kicks a player when no action was performed during amount of other player actions
        noActionTimes = 10, -- amount of difference required between most active player and checked player (crops harvested in this case)
        offlineTime = 5 * 60, -- kick player after amount of time offline
    },
    payout = {
        -- bonus system (there's a base payout and for each additional player bonus percentage)
        useBonusPercent = false, -- uses basePayout and bonusPercent per player
        basePayout = 500,
        bonusPercent = 0.25,
        -- custom (TOTAL AMOUNT)
        playerPayouts = {
            [1] = 300,
            [2] = 600,
            [3] = 900,
            [4] = 1200,
            [5] = 1500,
            [6] = 1800
        },
    },
    blips = {
        {
            hasJob = true, -- requires job (or display always when requireJob is set to false)
            activeJob = false, -- requires being in active job (in party)
            label = _L("start_job_blip"),
            coords =  vector3(2016.851, 4987.842, 41.09825),
            sprite = 272,
            color = 46,
            alpha = 255,
        },
        {
            hasJob = true, -- requires job (or display always when requireJob is set to false)
            activeJob = true, -- requires being in active job (in party)
            label = _L("sell_crops_blip"),
            coords = vector3(1724.345825, 4714.210449, 41.137386),
            sprite = 457,
            color = 46,
            alpha = 255,
        },
    },
}

Config.StandaloneControls = {
    ["put_crate"] = {
        key = 38, -- its E on keyboard, to change to diffrent key see https://docs.fivem.net/docs/game-references/controls/
        disabled = false
    },
    ["get_crops"] = {
        key = 38, -- its E on keyboard, to change to diffrent key see https://docs.fivem.net/docs/game-references/controls/
        disabled = false
    },
    ["sell_crops"] = {
        key = 38, -- its E on keyboard, to change to diffrent key see https://docs.fivem.net/docs/game-references/controls/
        disabled = false
    },
}

-- Animation times (in miliseconds), to implement your progress bar etc edit getCropAnim callback in editable_client.lua
Config.AnimTimes = {
    ["get_crop"] = 5000
}

-- removed for better visiblity
Config.Fields = {}

-- plant cooldown
Config.HarvestTime = 30

for k, v in ipairs(Config.Fields) do
    table.insert(Config.Job.blips, {
        label = _L("get_crops"),
        coords = v.zone.coords,
        sprite = 280,
        color = 46,
        scale = 1.0,
        hasJob = true, -- requires job (or display always when requireJob is set to false)
        activeJob = true, -- requires being in active job (in party)
    })
    table.insert(Config.Job.blips, {
        coords = v.zone.coords,
        area = vec2(v.zone.width, v.zone.length),
        color = 46,
        alpha = 120,
        rotation = v.zone.heading,
        hasJob = true, -- requires job (or display always when requireJob is set to false)
        activeJob = true, -- requires being in active job (in party)
    })
end

Config.AttachOffset = { model = `destiny_farm_vegetablesbox`, offset = { 0.335, 0.13, -0.195, -102.5, -12, 26.5 }, bone = 57005 }

Config.AfkTime = 60 * 60

Config.DisableFastMovement = true
Config.DisableControls = {
    21,
    22,
    24,
    25,
    44,
    68,
    140,
    141,
    142,
    257,
    263,
    264,
}

Config.MoneyItem = "money"