|
| 1 | +# Config |
| 2 | + |
| 3 | +### LOCALES |
| 4 | + |
| 5 | +- You can translate this script in every language, which you want in `locales/*.json*`. If you add your language, you can send it us in our discord and we will add it to our script |
| 6 | +- To configure which json file will be loaded as locales go to `config.lua` and set field `Config.Locales` to name of your file |
| 7 | + |
| 8 | +### LOGS |
| 9 | + |
| 10 | +To configure logs go to `s_config.lua` and put here your discord webhook |
| 11 | + |
| 12 | +- if you want to edit logs logic go to `server/editable/editable_logs.lua` |
| 13 | + |
| 14 | +```lua filename="s_config.lua" |
| 15 | +---@type string |
| 16 | +SConfig.Webhook = 'your_webhook_here' |
| 17 | +``` |
| 18 | + |
| 19 | +### FRAMEWORK NAMES |
| 20 | + |
| 21 | +```lua filename="config.lua" |
| 22 | +--- If you have custom name of exports / resourceName, change it here to script can works correctly. |
| 23 | +--- If you wanna connect your custom framework look at bridge/custom/*.lua. |
| 24 | +--- If you wanna edit your framework functions etc look at bridge/your_framework/*.lua |
| 25 | +---@type table<string, {resourceName: string, export: string}> |
| 26 | +Config.Framework = { |
| 27 | + ESX = { |
| 28 | + resourceName = "es_extended", |
| 29 | + export = "getSharedObject", |
| 30 | + }, |
| 31 | + QB = { |
| 32 | + resourceName = "qb-core", |
| 33 | + export = "GetCoreObject", |
| 34 | + }, |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +### COMMAND |
| 39 | + |
| 40 | +To configure command name, which will opening rewards for invitations menu you can do it in `config.lua` in field called `Config.ReferencesCommand` |
| 41 | + |
| 42 | +```lua filename="config.lua" |
| 43 | +---@type string |
| 44 | +Config.ReferencesCommand = 'references' |
| 45 | +``` |
| 46 | + |
| 47 | +### REWARDS PER INVITE |
| 48 | + |
| 49 | +The most important thing in this config is rewards. In this table, key is how many invites player need to claim this reward. If you wanna to give other rewards than items you can set custom type of them and implement giving them in `bridge/your_framework/server.lua` in function called `AddReward` |
| 50 | + |
| 51 | +```lua filename="config.lua" |
| 52 | +---@class ItemReward |
| 53 | +---@field name string |
| 54 | +---@field count number |
| 55 | +---@field type 'item' |
| 56 | + |
| 57 | +---@class OtherReward |
| 58 | +---@field name string |
| 59 | +---@field count number |
| 60 | +---@field type string |
| 61 | +---@field label string |
| 62 | +---@field image string |
| 63 | + |
| 64 | +---@alias ConfigReward ItemReward | OtherReward |
| 65 | + |
| 66 | + |
| 67 | +---@type table<number, ConfigReward> key is invited count, value is reward data |
| 68 | +Config.Rewards = { |
| 69 | + [1] = { |
| 70 | + name = 'burger', |
| 71 | + count = 3, |
| 72 | + type = 'item' |
| 73 | + }, |
| 74 | + [2] = { |
| 75 | + name = 'money', |
| 76 | + count = 500, |
| 77 | + type = 'item' |
| 78 | + }, |
| 79 | + [3] = { |
| 80 | + name = 'burger', |
| 81 | + count = 5, |
| 82 | + type = 'item' |
| 83 | + }, |
| 84 | + [4] = { |
| 85 | + name = 'burger', |
| 86 | + count = 5, |
| 87 | + type = 'item' |
| 88 | + }, |
| 89 | + [5] = { |
| 90 | + name = 'ammo-9', |
| 91 | + count = 20, |
| 92 | + type = 'item' |
| 93 | + }, |
| 94 | + [6] = { |
| 95 | + name = 'burger', |
| 96 | + count = 5, |
| 97 | + type = 'item' |
| 98 | + }, |
| 99 | + [7] = { |
| 100 | + name = 'burger', |
| 101 | + count = 5, |
| 102 | + type = 'item' |
| 103 | + }, |
| 104 | + [8] = { |
| 105 | + name = 'WEAPON_PISTOL', |
| 106 | + count = 1, |
| 107 | + type = 'item' |
| 108 | + }, |
| 109 | +} |
| 110 | +``` |
| 111 | + |
| 112 | +### REWARDS FOR ENTER CODE |
| 113 | + |
| 114 | +To encourage players to enter referral codes, when they enter a friend's code they also get rewards. You can configure these rewards here. Logic is the same as above |
| 115 | + |
| 116 | +```lua filename="config.lua" |
| 117 | +---@type ConfigReward[] 3/4 elements should looks good |
| 118 | +Config.RewardsForEnterCode = { |
| 119 | + { |
| 120 | + name = 'burger', |
| 121 | + count = 5, |
| 122 | + type = 'item' |
| 123 | + }, |
| 124 | + { |
| 125 | + name = 'money', |
| 126 | + count = 10000, |
| 127 | + type = 'item' |
| 128 | + }, |
| 129 | + { |
| 130 | + name = 'WEAPON_KNIFE', |
| 131 | + count = 1, |
| 132 | + type = 'item' |
| 133 | + } |
| 134 | +} |
| 135 | +``` |
0 commit comments