Configuration

This page contains all information you need to configure gfg_drugtables, if you have any questions feel free to reach out to us on our discord

Config

Config = {
    Language = "en",
    debug = false,
    enhancedDebug = false,
    interactionMethod = "target",
    interactionDistance = 2,     
    target = "ox_target",
    inventory = "ox_inventory",
    targetWaitTime = 1000, 
    particleFxWaitTime = 30000,
    placeTableHelpNotification = true,
    canPlaceTableInWater = false,
    canPlaceTableOnRoad = false,
}

Language

Language sets which Locale to use, you can find available locales in [gfg_drugtables/locale/], we will add more as they become available but feel free to add your own.

Language = "en",

Debug

Debug should only used in a development environment

Determines whether to send debug print statements to the client and server when using the script

Debug = false

enhancedDebug

Enhanced Debug should only used in a development environment

Determines whether to send enhanced debug print statements to the client and server when using the script

enhancedDebug = false,

interactionMethod

Determines the method in which players interact with a table. Currently supported options are: "target", "textui", "3dtext".

interactionMethod = "target",

interactionDistance

Determines the distance from the table that the interaction is activated.

interactionDistance = 2,

target

Determines wich target resource to use.

Currently supported options are"

  • "ox_target"

  • "qb_target"

target = "ox_target",

inventory

Setting inventory to "custom" will utilize the function in server/sv_customize.lua

Determines wich inventory resource to use.

Currently supported options are:

  • "ox_inventory"

  • "qb_inventory"

  • "custom"

inventory = "ox_inventory",

targetWaitTime

1000 is probably fine but if you experience high resource usage you may need to increase this.

Determines the amount of time the client checks for nearby table to create a target for.

In Milliseconds

targetWaitTime = 1000,

particleFxWaitTime

30000 is probably fine but if you experience high resource usage you may need to increase this.

Determines the amount of time the client checks for nearby tables that are cooking to make particle effects.

In Milliseconds

particleFxWaitTime = 30000,

placeTableHelpNotification

Determines whether or not to show the help notification when placing a table.

placeTableHelpNotification = true

canPlaceTableInWater

Your housing script may place certain shells under the map, in those cases the shell may be registered as "Underwater" if this is the case you may need to set this to false.

Determines if the player can place a table while in or under water.

canPlaceTableInWater = false

canPlaceTableOnRoad

May or may not work on all roads.

Determines if the player can place a table on a road

canPlaceTableOnRoad = false,

Config.PackTable

This is the configuration section for when the player is placing, and packing the table.

Config.PackTable = {                                        
    animation = {                                           
        dict = "amb@world_human_gardener_plant@male@idle_a",
        anim = "idle_b",                                    
    },
    skillcheck = {                                          
        enable = false,                                     
        difficulty = {'easy', 'easy', 'easy', 'medium'},    
        keys = {'e'},                                       
    },
    getItemOnFailedPack = true,                             
    durabilityLossOnFailedPack = true,                       
    durabilityLossOnFailedPackAmount = {                     
        min = 0.1,
        max = 0.5,
    },
    progressBar = {                                 
        time = 1000,  
        cancelable = true,                                      
    },
    placementKeys = {
        place = 22,
        cancel = 47,
        rotateRight = 175,
        rotatLeft = 174,
        rotateSpeed = 1.0
    }
}

animation

Animation that plays during placing and packing, a list of available animations can be found here (https://alexguirre.github.io/animations-list/).

  • dict = Dictionary that is used to determine the animation in the list given above, it would be the bigger text.

  • anim = Animation that's is used within the dictionary determined, in the list given above, it would be the smaller text.

    animation = {                                           
        dict = "amb@world_human_gardener_plant@male@idle_a",
        anim = "idle_b",                                    
    },

skillCheck

Skill Check that is used when the player attempts to place or pack the table.

  • enable = Determines whether the skill check will be used or not.

  • difficulty = Determines the difficulty of the skill check, information on how to customize this can be found here (https://overextended.github.io/docs/ox_lib/Interface/Client/skillcheck).

  • keys = Determines the keys used during the skill check, information on how to customize this can be found here (https://overextended.github.io/docs/ox_lib/Interface/Client/skillcheck).

    skillcheck = {                                          
        enable = true,                                     
        difficulty = {'easy', 'easy', 'easy', 'medium'},    
        keys = {'e'},                                       
    },

getItemOnFailedPack

If 'true' the player will succeed with the place/pack of the table regardless of the result of the skill check. If 'false' the table will remain if the player fails the skill check.

getItemOnFailedPack = true, 

durabilityLossOnFailedPack

If 'true' the table will experience random durability loss when the player fails the place/pack skill check.

durabilityLossOnFailedPack = true,

durabilityLossOnFailedPackAmount

Durability Loss can be a float! (00.01 = 100.00)

Determines the amount of durability the table looses when the player fails the place/pack skill check. If you want it to be a static value set the 'min' and 'max' to the same number.

    durabilityLossOnFailedPackAmount = {                     
        min = 0.1,
        max = 1.0,
    },

progressBar

Progress Bar that is used when the player is placing or packing the table.

  • time = Determines the time it takes for the progress bar to complete (in milliseconds).

  • cancelable = Determines if the player can cancel the placing and packing progress bar.

    progressBar = {                                                                              
        time = 1000,
        cancelable = true,                                        
    }

placementKeys

Determines the keys used when placing a table.

  • place = This key is used to place the table (Default: Space).

  • cancel = This key is used to cancel placement (Default: G).

  • rotateRight = This key is used to rotate the table right (Default: Arrow Right).

  • rotateLeft = This key is used to rotate the table right (Default: Arrow Left).

  • rotateSpeed = This Determines the speed that the table is rotated.

    placementKeys = {
        place = 22,
        cancel = 47,
        rotateRight = 175,
        rotatLeft = 174,
        rotateSpeed = 1.0
    }

Config.StaticTables

This is the configuration section for static tables, these tables cannot be "packed" and do not have a prop

Static tables are based on "box zones", since you already have ox_lib creating a zone is quite simple, simple type /zone box and follow the instructions, more information on creating zones can be found here (https://overextended.github.io/docs/ox_lib/Zones/Shared#zone-creation-script).

The 'key' for each static table (in the example sandyMethTable) needs to be unique.

Config.StaticTables = {
    sandyMethTable = {
        label = "Sandy Meth Table",
        type = 'meth',
        coords = vec3(1391.11, 3605.59, 38.8),
        size = vec3(1.0, 2.15, 0.15000000000001),
        rotation = 20.25,
    },    
}

label

This is the label of the table in menu and for interaction.

label = "Sandy Meth Table",

type

This is the type of table, needs to match one of the 'type's from Config.DrugTables.

type = 'meth',

coords

Coordinates of the static table.

coords = vec3(1391.11, 3605.59, 38.8),

size

Size of the static table.

size = vec3(1.0, 2.15, 0.15000000000001),

rotation

Rotation of the static table.

rotation = 20.25,

Config.DrugTables

This is the configuration section for each type of drug table.

Any values related to durability or temperature can accept floats (number with a decimal place). However more decimal places the float has, the higher the likelihood that issues could arise. We recommend to never go more than 2 decimal places (1.25).

Config.DrugTables = {
    meth = {                                                     
        name = "Meth",                                           
        type = "meth",                   
        tableItem = "methtable",                                 
        prop = 'bkr_prop_meth_table01a',                         
        animation = {                                            
            dict = "amb@world_human_gardener_plant@male@idle_a", 
            anim = "idle_b",                                     
        },
        itemsNeeded = {                                          
            [1] = {name = 'methingredient1', amount = 1},        
            [2] = {name = "methingredient2", amount = 1},                
            [3] = {name = "methingredient3", amount = 1},                
            [4] = {name = "methingredient4", amount = 1},                
            [5] = {name = "methingredient5", amount = 1},
            [6] = {name = "methingredient6", amount = 1},
            [7] = {name = "methingredient7", amount = 1},
        },
        skillCheck = {               
            enable = true,                                       
            difficulty = {'easy', 'easy', 'easy', 'medium'},
            keys = {'e'},                                        
            loseIngredientsOnFail = true,                        
            durabilityLossOnFail = {                             
                enable = true,                                   
                min = 0.5,                                       
                max = 1.0,                                       
            },                       
        },
        progressBar = {                                          
            enable = true,               
            time = 1000,                                         
        },
        collectProgressBar = {                                   
        enable = true,                                           
        time = 1000,                                             
        },
        cookTime = 100,                                          
        cookReward = {                                           
            [1] = {name = "meth", amount = 5,}                                                                                               
        },
        cookingTempRise = {
            enable = true,
            min = 0.5,
            max = 1.0,
        },
        tempDurabilityDecay = {
            enable = true,
            min = 2.0,
            max = 4.0,
        },
        cooling = {
            water = {
                enable = true,
                item = 'waterbottle',
                amount = {min = 10, max = 15},
                progressBar = {                                         
                    enable = true,                                      
                    time = 1000,                                        
                },
            },
            fan = {
                enable = true,
                prop = 'prop_fan_01',
                item = 'drugtablefan',
                amount = {min = 0.75, max = 1.5},
                offset = {x = 1.3, y = 0.05, z = 0.0},
                rotation = {x = 0.0, y = 0.0, z = -90},
                progressBar = {                                         
                    enable = true,                                      
                    time = 1000,                                        
                },
            }
        },
        ambientTempDecay = {
            enable = true,
            min = 0.1,
            max = 0.5,
        },
        durabilityDecay = {                                      
            enable = true,                                       
            min = 0.1,                                           
            max = 0.5,                                           
        },
        particleEffects = {
            [1] = {
            enable = true, 
            dict = 'core', 
            effect = 'ent_amb_cig_smoke_linger', 
            scale = 0.7, 
            offset = {x = 0.0, y = 0.0, z = 0.9}, 
            alpha = 80
            },
            [2] = {enable = true, dict = 'core', effect = 'ent_anim_weed_smoke',                                                    scale = 2.0, offset = {x = 0.15, y = 0.0, z = 0.9}, alpha = 100},
        },
        durabilityExplosion = {
            [1] = {
            type = "explosion", 
            enable = true, 
            explosion = 49, 
            noDamage = false, 
            damageScale = 1.0, 
            audible = true, 
            invisible = false, 
            cameraShake = 1.0
            },
        }
    },
}

name

Determines the tables "Name" when opening the menu (i.e. "Meth Table 1"), Can be whatever you choose and does not have to be unique.

name = "Meth", 

type

type needs to be unique, two or more tables CANNOT share the same type.

The table type, usually set to a lowercase version of the name.

type = "meth",  

tableItem

multiple tables CANNOT share the same table item.

The inventory item that represents this table type.

tableItem = "methtable",

prop

The name of the prop that is used for this table type, more props can be found here (https://forge.plebmasters.de/objects).

prop = 'bkr_prop_meth_table01a', 

animation

Animation that plays during the start of the cook and during collection, a list of available animations can be found here (https://alexguirre.github.io/animations-list/).

  • dict = Dictionary that is used to determine the animation in the list given above, it would be the bigger text.

  • anim = Animation thats is used within the dictionary determined, in the list given above, it would be the smaller text.

        animation = {                                            
            dict = "amb@world_human_gardener_plant@male@idle_a", 
            anim = "idle_b",                                     
        },

itemsNeeded

Determines the items needed in order for the player to start the cook at this type of table.

These tables need to be 'keyed' meaning they follow the given format:

[number] = {name = 'name', amount = number},

  • name = the item name within your inventory system.

  • amount = the amount of that item the player needs to have on them.

        itemsNeeded = {                                          
            [1] = {name = 'methingredient1', amount = 1},        
            [2] = {name = "methingredient2", amount = 1},                
            [3] = {name = "methingredient3", amount = 1},                
            [4] = {name = "methingredient4", amount = 1},                
            [5] = {name = "methingredient5", amount = 1},
            [6] = {name = "methingredient6", amount = 1},
            [7] = {name = "methingredient7", amount = 1},
        },

skillCheck

Skill Check that is used when the player attempts to start the cook.

enable = Determines whether the skill check will be used or not.

difficulty = Determines the difficulty of the skill check, information on how to customize this can be found here (https://overextended.github.io/docs/ox_lib/Interface/Client/skillcheck).

keys = Determines the keys used during the skill check, information on how to customize this can be found here (https://overextended.github.io/docs/ox_lib/Interface/Client/skillcheck).

loseIngredientsOnFail = If 'true' the player loses all the ingredients when they fail the skill check. If 'false' they get the items back.

durabilityLossOnFail = Determines if the table looses durability when the player fails the cooking skillcheck.

durabilityLossOnFail.enable = Set to 'true' to enable, 'false' to disable.

durabilityLossOnFail.min = Determines the minimum amount of durability to be lost.

durabilityLossOnFail.max = Determines the maximum amount of durability to be lost.

        skillCheck = {                                           
            enable = true,                                       
            difficulty = {'easy', 'easy', 'easy', 'medium'},     
            keys = {'e'},                                        
            loseIngredientsOnFail = true,                        
            durabilityLossOnFail = {                             
                enable = true,                                   
                min = 0.5,                                       
                max = 1.0,                                       
            },                       
        },

progressBar

Progress Bar that is used when the player is starting a cook.

enable = if 'true' the progress bar will play before the cook is started.

time = Determines the time it takes for the progress bar to complete (in milliseconds).

        progressBar = {                                          
            enable = true,                                       
            time = 1000,                                         
        },

collectProgressBar

Progress Bar that is used when the player is collecting the reward after cooking.

enable = if 'true' the progress bar will play before the cook is started.

time = Determines the time it takes for the progress bar to complete (in milliseconds).

        collectProgressBar = {                                   
        enable = true,                                           
        time = 1000,                                             
        },

cookTime

Determines how long it takes for a cook to finish on a table of this type

(in Minutes, minimum is 1).

        cookTime = 100,  

cookReward

Determines what they player gets when the cook is finished and he collects it from the table. Can be multiple items (can receive byproducts from production).

These tables need to bey 'keyed' meaning they follow the given format:

[number] = {name = 'name', amount = number},

name = the item name within your inventory system.

amount = the amount of that item the player receives.

        cookReward = {                                           
            [1] = {name = "meth", amount = 5,} 
            [2] = {name = "byproduct1", amount = 5,}                                                                                              
        },

cookingTempRise

Determines the temperature rise while the table is cooking.

enable = if 'true' the temp will rise while the table is cooking.

min = Determines the minimum amount to rise the temperature every tick (1 Minute).

max = Determines the maximum amount to rise the temperature every tick (1 Minute).

        cookingTempRise = {
            enable = true,
            min = 0.5,
            max = 1.0,
        },

tempDurabilityDecay

Durability Decay while the temp is over 82.0

enable = if 'true' the durability will reduce while the temp is over 82.0.

min = Determines the minimum amount to reduce the durability every tick (1 Minute).

max = Determines the maximum amount to reduce the durability every tick (1 Minute).

    tempDurabilityDecay = {
        enable = true,
        min = 2.0,
        max = 4.0,
    },

cooling

Ways to cool the table and reduce temperature.

water

Uses a water item for a one time reduction in temp

enable = If set to 'true' enables the use of water.

item = The name of the item used to pour water on the table.

amount = The amount to reduce the temperature when used. (Random between min and max)

progressBar.enable = If set to 'true' turns the progress bar on.

progressBar.time = Determines the amount of time the progress bar will take (in Milliseconds).

        water = {
            enable = true,
            item = 'waterbottle',
            amount = {min = 10, max = 15},
            progressBar = {                                         
                enable = true,                                      
                time = 1000,                                        
            },
        },

fan

Uses a fan item for a steady reduction in temperature every tick (1 Minute).

enable = If set to 'true' enables the player to install a fan.

prop = Determines the in-game prop to spawn when a fan is installed.

item = The name of the item used to install the fan to the table.

amount = The amount to reduce the temperature every tick (1 Minute). (Random between min and max)

offset = The prop offset compared to the table. (If using the default props, no need to change this.)

rotation = The prop rotation compared to the table. (If using the default props, no need to change this.)

progressBar.enable = If set to 'true' turns the progress bar on.

progressBar.time = Determines the amount of time the progress bar will take (in Milliseconds).

    fan = {
        enable = true,
        prop = 'prop_fan_01',
        item = 'drugtablefan',
        amount = {min = 0.75, max = 1.5},
        offset = {x = 1.3, y = 0.05, z = 0.0},
        rotation = {x = 0.0, y = 0.0, z = -90},
        progressBar = {                                         
            enable = true,                                      
            time = 1000,                                        
        },
    }

Both

cooling = {
    water = {
        enable = true,
        item = 'waterbottle',
        amount = {min = 10, max = 15},
        progressBar = {                                         
            enable = true,                                      
            time = 1000,                                        
        },
    },
    fan = {
        enable = true,
        prop = 'prop_fan_01',
        item = 'drugtablefan',
        amount = {min = 0.75, max = 1.5},
        offset = {x = 1.3, y = 0.05, z = 0.0},
        rotation = {x = 0.0, y = 0.0, z = -90},
        progressBar = {                                         
            enable = true,                                      
            time = 1000,                                        
        },
    }
},

ambientTempDecay

Reduces temperature while the table is not cooking, until it reaches ambient (22.0)

enable = if 'true' the temp will reduce while the table is not cooking.

min = Determines the minimum amount to reduce the temperature every tick (1 Minute).

max = Determines the maximum amount to reduce the temperature every tick (1 Minute).

    ambientTempDecay = {
        enable = true,
        min = 0.1,
        max = 0.5,
    },

durabilityDecay

If enabled this removes the random amount of durability from the table while cooking every 1 minute.

Determines if the table loses durability while cooking.

enable = Set to 'true' to enable, 'false' to disable.

min = Determines the minimum amount of durability to be lost.

max = Determines the maximum amount of durability to be lost.

        durabilityDecay = {                                      
            enable = true,                                       
            min = 0.1,                                           
            max = 0.5,                                           
        },

particleEffects

While this section can take as many particle effects as you like, too many may cause performance issues.

Particle effects the table produces while cooking.

A list of available particle effects can be found here. (https://vespura.com/fivem/particle-list/)

enable = If set to 'true' enables the particle effect.

dict = Determines the particle effect dictionary.

effect = Determines the effect to be played.

scale = Determines the effect scale.

offset = Determines the where to play the effect relative to the table.

alpha = Determines the alpha of the effect (transparency).

    particleEffects = {
        [1] = {
            enable = true,
            dict = 'core',
            effect = 'ent_amb_cig_smoke_linger',
            scale = 0.7,
            offset = {x = 0.0, y = 0.0, z = 0.9},
            alpha = 80
        },
        [2] = {enable = true, dict = 'scr_fm_mp_missioncreator', effect = 'scr_mp_drug_dst', scale = 1.0, offset = {x = 0.0, y = 0.0, z = 0.9}, alpha = 100},
    },

durabilityExplosion

This section can take explosion as well as particle effects, refer to the particleEffects section for help when using effects.

Explosions and particle effects to play when the table is cooking AND durability reaches 0.

Information on explosion types can be found here:

(https://docs.fivem.net/natives/?_0xE3AD2BDBAEE269AC)

type = Determines the effect type, can be 'explosion' or 'effect'.

enable = If set to 'true' the explosion will be used.

explosion = Determines which explosion type will be used. (See link above)

noDamage = If set to 'true', no damage will result from the explosion (to players or vehicles etc.)

damageScale = Sets the Damage scale of the explosion.

audible = If set to 'true' the explosion will be audible (heard).

invisible = If set to 'true' the explosion will be invisible (But still give damage).

cameraShake = Determines the amount of camera shake players nearby experience.

    durabilityExplosion = {
        [1] = {
            type = "explosion",
            enable = true,
            explosion = 49,
            noDamage = false,
            damageScale = 1.0,
            audible = true,
            invisible = false,
            cameraShake = 1.0
        },
        [2] = {
            type = "effect", 
            enable = true, 
            dict = 'scr_ie_svm_technical2', 
            effect = 'scr_dst_cocaine', 
            scale = 2.0, 
            offset = {x = 0.0, y = 0.0, z = 0.9}, 
            alpha = 100
        },
    }

Example Config

This is an example config to show you the layout, the values here are not meant for production.

Config = {
    Language = "en",
    debug = false,
    enhancedDebug = false,
    interactionMethod = "target",
    interactionDistance = 2,     
    target = "ox_target",
    inventory = "ox_inventory",
    targetWaitTime = 1000, 
    particleFxWaitTime = 30000,
    placeTableHelpNotification = true,
    canPlaceTableInWater = false,
    canPlaceTableOnRoad = false,  
}

Config.PackTable = {                                        
    animation = {                                           
        dict = "amb@world_human_gardener_plant@male@idle_a",
        anim = "idle_b",                                    
    },
    skillcheck = {                                          
        enable = false,                                     
        difficulty = {'easy', 'easy', 'easy', 'medium'},    
        keys = {'e'},                                       
    },
    getItemOnFailedPack = true,                             
    durabilityLossOnFailedPack = true,                       
    durabilityLossOnFailedPackAmount = {                     
        min = 10,
        max = 25,
    },
    progressBar = {
        time = 1000,   
        cancelable = true,                                     
    }
}

Config.DrugTables = {
    meth = {                                                     
        name = "Meth",                                           
        type = "meth",                                           
        tableItem = "methtable",                                 
        prop = 'bkr_prop_meth_table01a',                         
        animation = {                                            
            dict = "amb@world_human_gardener_plant@male@idle_a", 
            anim = "idle_b",                                     
        },
        itemsNeeded = {                                          
            [1] = {name = 'methingredient1', amount = 1},        
            [2] = {name = "methingredient2", amount = 1},                
            [3] = {name = "methingredient3", amount = 1},                
            [4] = {name = "methingredient4", amount = 1},                
            [5] = {name = "methingredient5", amount = 1},
            [6] = {name = "methingredient6", amount = 1},
            [7] = {name = "methingredient7", amount = 1},
        },
        skillCheck = {                                           
            enable = true,                                       
            difficulty = {'easy', 'easy', 'easy', 'medium'},     
            keys = {'e'},                                        
            loseIngredientsOnFail = true,                        
            durabilityLossOnFail = {                             
                enable = true,                                   
                min = 0.5,                                       
                max = 1.0,                                       
            },                       
        },
        progressBar = {                                          
            enable = true,                                       
            time = 1000,                                         
        },
        collectProgressBar = {                                   
        enable = true,                                           
        time = 1000,                                             
        },
        cookTime = 100,                                          
        cookReward = {                                           
            [1] = {name = "meth", amount = 5,}                                                                                                               
        },
        cookingTempRise = {
            enable = true,
            min = 0.5,
            max = 1.0,
        },
        tempDurabilityDecay = {
            enable = true,
            min = 2.0,
            max = 4.0,
        },
        cooling = {
            water = {
                enable = true,
                item = 'waterbottle',
                amount = {min = 10, max = 15},
                progressBar = {                                         
                    enable = true,                                      
                    time = 1000,                                        
                },
            },
            fan = {
                enable = true,
                prop = 'prop_fan_01',
                item = 'drugtablefan',
                amount = {min = 0.75, max = 1.5},
                offset = {x = 1.3, y = 0.05, z = 0.0},
                rotation = {x = 0.0, y = 0.0, z = -90},
                progressBar = {                                         
                    enable = true,                                      
                    time = 1000,                                        
                },
            }
        },
        ambientTempDecay = {
            enable = true,
            min = 0.1,
            max = 0.5,
        },
        durabilityDecay = {                                      
            enable = true,                                       
            min = 0.1,                                           
            max = 0.5,                                           
        },
        particleEffects = {
            [1] = {enable = true, dict = 'core', effect = 'ent_amb_cig_smoke_linger', scale = 0.7, offset = {x = 0.0, y = 0.0, z = 0.9}, alpha = 80},
            [2] = {enable = true, dict = 'core', effect = 'ent_anim_weed_smoke', scale = 2.0, offset = {x = 0.15, y = 0.0, z = 0.9}, alpha = 100},
        },
        durabilityExplosion = {
            [1] = {type = "explosion", enable = true, explosion = 49, noDamage = false, damageScale = 1.0, audible = true, invisible = false, cameraShake = 1.0},
        }
    },
}

Last updated