🔧Config

Explanations for all config values.

Having trouble?

If you feel like we have explained any value poorly, please let us know on Discord so that we can update the documentation so that everyone understands it easily.

To understand the structure

Because we have extensive configuration files, nested tables is an inevitability. To keep track of which values are for which table we use the tablename.value. This can also stack, for example location.blip.enabled etc.

shared/config.lua

Settings

debug

If set to true, it will print out information in the console, false to disable it. Some information will still be printed out, such as missing arguments, despite this being disabled.

blipsForLocations

For debug purposes only, enable this and you will be able to see all of the locations marked on the map.

distanceFormat

Set to "km" to have it in kilometers, "mi" to have it in miles. This distance will be outputted when you check distance to the customer.

policeRequirement

If you want to have a minimum amount of police for deals to be created, set this to any number above 0.

policeJob

Most of the time you can leave this default, but if your desired job is not named "police", you can change it here.

status

Settings regarding the status of what you want to sell.

status.enabled

Set to true if you wish to enable the status app on the phone. Using this app you can set which drugs you want messages for. Note that this can drastically change the amount of messages you get as some locations won't have any preferences for your drugs at all.

status.overridePreferences

This setting is a powerful one. By default, all locations will have preferences for which drugs they want to buy. If you set this setting to true along with status.enabled set as true, you will ignore all preferences and always get offers for your exact prefereneces.

status.shortenTimerUponPreferenceCalamity

If you have status enabled without overridePreferences enabled, if your settings makes it impossible for a sale to be generated, the time until your next sale will be divided by this value. This was created to avoid long punishments if you don't have the desired drugs on you.

policeAlert

A collection of settings for the alerting to the police.

policeAlert.enabled

true/false to enable or disable police alerts.

policeAlert.callPoliceChance

Chance for the police to be claled when you finish a drug deal or when it gets cancelled (Ped frightened, running cancel). Note that this has no effect if the expiration time has been reached.

policeAlert.delay

In seconds, specify two values and a random value will be chosen upon a deal cancelling. This value is the delay before the police gets the notification.

policeAlert.blipRadius

Radius of the blip.

policeAlert.blipLast

In seconds, how long the blip will last on the map for the police.

smartSettings

A collection of settings regarding our smart features for the script, such as cancelling a deal if you perform suspicious behaviour.

smartSettings.running.range

false / 0 to disable, set as an integer which will be how close you have to be before the running settings takes effect.

smartSettings.running.cancelDeal

true/false to enable/disable the deal cancelling if you run too close to the customer, if range is enabled. You will receive a notification that your behaviour was suspicious and that the customer was no longer interested.

smartSettings.running.policeAlertAddition

Percentage points added to callPoliceChance if you're running close to the customer, same as above. Only applies if smartSettings.running.cancelDeal is deactivated.

smartSettings.cancelIfFrigthened

true/false to enable/disable the deal cancelling if the ped is frightened, which means you attacking it, aiming at it with a weapon etc.

smartSettings.cancelIfInCombat

true/false to enable/disable the deal cancelling if the ped is in combat, which means that it changes stance and tries to fight you.

smartSettings.pedExistanceForAlert

false/0 to disable, any number higher than 0 and it will be activated. This setting ensures that a ped has to be nearby in order for the police to be called if the deal is cancelled. This is to simulate realism because someone actually has to be nearby to report it. Note that this will only work if you actually have peds enabled on your server, since it has to naturally walk/drive by.

smartSettings.noItemsAddition

Percentage points added towards the chance that police will be called if you don't have the items the customer wants.

customerSettings

A collection of settings regarding customers.

customerSettings.timeToFindCustomer

In seconds, it will choose a random time between min and max and wait that long before finding a customer.

customerSettings.timeBeforeOfferExpires

In seconds, how long before an offer gets cancelled automatically, meaning it gets "declined" without you having to manually do it. Will choose a number between min and max.

customerSettings.timeBeforeCustomerLosesInterest

In seconds, if you accept the offer this is the amount of time you have to deliver the product. It will choose a number between min and max.

customerSettings.cooldownForLocation

In seconds, cooldown for a position to be able to respawn. Note that this is not meant to be restricted for hours, this is simply put in place so that people don't AFK superior locations and ruin the purpose of the script. Will choose a random number between min and max.

customerSettings.dealTime

In seconds, how long it takes to complete the deal (Talking to the customer). Will choose a number between min and max.

customerSettings.maxRangeForOffer

In units, this was put in place so that you don't get offers in Sandy Shores when you're in Grove Street.

customerSettings.minRangeForOffer

In units, this was put in place to prevent you getting offers next to eachother, to encourage some activity within the script where you have to drive around, carry a bigger risk of being seen etc. Basically you have to be at least how much you entered in away from a location for it to be available.

customerSettings.callToConfirm

true/false to enable/disable the calling feature. If enabled, you will be prompted with a call with the customer when deciding to accept the offer. If disabled, it will just accept the offer instantly when pressing the call button.

openPhone

A collection of ways to open the phone.

openPhone.item

The item needed to open the phone.

openPhone.command.enabled

true/false to enable/disable a command to open the phone.

openPhone.command.itemNeeded

true/false to enable/disable item requirement when using a command to open the phone.

openPhone.command.name

The command to open the phone, if it is enabled.

openPhone.useItem.enabled

true/false to enable/disable the item to be used (Drag item to use in inventory) to open the phone.

openPhone.blockedJobs

Block jobs from being able to access the phone by adding them in here.

newCustomerAlert

Global configurations for notifications when you get a new offer. If you enable all of them, each person can individually disable it. But if you disable it in the config, you can't enable it individually.

newCustomerAlert.notification

true/false to enable/disable a notification to appear when you get a customer

newCustomerAlert.file

The filename of the alert / audio notification you will receive when you get a customer. Set it to an empty string `""` if you wish to disable it.

phoneCall

Settings for the phone call.

phoneCall.cutAtLength

How many milliseconds you want the call to go on for. Default is 5500 which means 5.5 seconds.

phoneCall.file

The filename of the talking audio. Set it to an empty string `""` if you wish to disable it.

animations

Customes will choose a random animation from this table when being spawned in. You can add as many as you want, just follow the format.

talkingAnim

This is the talking dictionary and animation for your character when interacting with the customer.

events

Client events that will be triggered throughout the script. This was put in place to expand the possibilities of the script without having the code leaked, since I don't offer open source resources. Args mean that the first argument will contain a table of what is in the parenthesis (args: (reason)).

events.offerDeclined

When you decline the offer, this triggers.

events.offerCreated

When a offer is generated and a message is sent to your phone, this triggers. Args will be the same that is sent to your client to store the necessary data for that location. The args are: (id, drug, amount, price, smartSettings, accepted).

events.offerExpired

When you call a customer and accept the offer, this triggers.

events.offerAccepted

When you call the customer and get the location, this event triggers. All necessary dealData, same as events.offerCreated, will be sent as args.

events.dealCompleted

args: (item, amount), when you have spoken to the customer and completed the deal, this will trigger.

events.dealCancelled

args: (reason), if you do anything suspicious to end the deal, lack items etc, this will trigger.

logs

Enable or disable logs for certain actions.

logs.dealCreated

When you disable airplane mode and get a message with an offer, this will get triggered.

logs.dealExpired

If you leave the message for too long without accepting it, this till get triggered.

logs.dealFinished

When you complete the deal and sell your drugs, this will get triggered.

logs.dealCancelled

If you cancel the deal by taking too long, running when too close to the customer if that smart setting is enabled, get in combat or frighten the ped, this will get triggered.

Drugs

This is the table you add all the drugs you want to sell. The script comes pre configured with everything available such as props, rotations etc and won't have an explanation area since it's mostly trial and error.

label

The label you want to display in the message on the phone.

item

The actual item you want to sell, for example "coke_pooch", "weedleaf_quality2" etc.

drugAmount

A random number between the min and max will be chosen for that deal.

rewards

Configure what rewards you want for this product

rewards.currency & rewards.item

This is where you decide what type of reward you want. If you want to be given money, you set currency to the money type you want to be given, for example "money", "dirty_money" or what ever you need. If you want an item, set item to the item you want. For example, item = "beer".

rewards.amount

The amount you want to be given per gram the customer wants. It's set as "amount" to make sense for items, but you can otherwise think of it as the price. priceGenerosity in Config.Locations will adjust this based on regions, if you have set priceGenerosity to anything other than 1.0.

rewards.chance

This is the chance for that reward to be randomly selected. Note that when selecting a random reward, it will check chances top to bottom. The chance caps at 100, meaning that if you have 4 items that have a combined chance of 100, a fifth item won't even be in the "raffle" to be selected.

rewards.multiplyWithAmount

This was added mainly for rare items. What it does is it caps the amount of that item you will be given to the reward amount, meaning that if the buyer wants 4 grams of marijuana, the reward won't be 4 * amount, it will only be the reward.

prop

Enable/disable it by commenting out / removing the entire prop table. You can also solely disable it for one participant by only commenting out / removing that table, instead of the whole prop table. Might have to play around with the values in here, they're hard to get correct. My recommendation is to use a third party script to test out bones, props, animations, offsets and rotations as they're hard to get correct.

Messages

In order to make the conversations seem more natural and realistic, I created a system to easily make these conversations. View the code block below for the explanation.

-- Valid values are: "{name}", "{amount}", "{price}", "{fullprice}", price is price per gram
"You in the area? Need some {name}, what can I get for {fullprice}?",
"Need some stuff quick, I'll pay {price}/g for some {name}.",
"Got any {name}? I need {amount}g asap.",
"I need {amount}g of {name}, I'll pay {price}/g.",
"Got {amount}g of {name} for me? I'll pay {price}/g.",
"Bro, can you do {fullprice} for {amount}g of {name}? Need some asap.",
"Need {amount}g of {name}, you got any?",

The values above are the same as in the config. Explanations for what values are accepted exist both here and in the config. You can easily add more by simply following the format and creating a new string below the previous one.

Locations (Separate file locations.lua but is part of config)

Adding locations is very simple. The first thing to do it to recognize the format. Below, I will explain what each table keys mean.

pos

pos requires a vector4 value, which means vector4(0, 0, 0, 0). The values are x, y, z, w. W is heading for that customer.

priceGenerosity

Basically a price multipler, all values from 0.1-infinity is accepted. It will take the value you entered and then take 1, perform a math.random() on those values and the outcome is that random value. Which means that if you set it to 0.8, the values will be between 0.8-1 (20% below default). If you set it to 1.3, that means the values can be between 1-1.3 (30% above default). Set to 1 to keep the price default. This was put in place to simulate realism, where poorer areas pay less and richer areas pay more to get their fix.

drugPreference

To simulate realism, areas can have drug preferences. For example, there can be homeless areas with crackers that want stronger drugs than marijuana, this is really easy to set up. You're also able to have multiple preferences. You can also disable this entirely by removing the entire key or leaving the table empty. If you're confused, you can view the config and see exactly what it would look like.

peds

To simualte realism, ped models can be changed for each location and also be selected at random. Just insert the ped model as a stirng in the peds table and it'll choose randomly for there.

Last updated