Configuration
Everything lives in config.lua, which stays editable in both the Open and Encrypted variant. There are no framework, inventory or notification options - those are handled by vns-core.
General options
| Option | Default | What it does |
|---|---|---|
Config.Locale |
'en' |
Which locale from locales/ is used. |
Config.DrawDistance |
25 |
Distance at which the steal marker is drawn. |
Config.ProgressBars |
true |
Show a progress bar during the 8 s connecting and 5 s stealing phases. With false the phases still take the same time, just without a bar. |
Config.HackLevel |
6 |
Difficulty passed to the hacking minigame. |
Config.HackTime |
40 |
Time limit (seconds) passed to the hacking minigame. |
Config.Cooldown |
900 |
Cooldown in seconds between missions, shared across all USB colors, per character. |
How the cooldown behaves
The cooldown starts when a mission actually begins - after a successful hack with a free location assigned. A failed hack or "no location" does not trigger it. It is held in server memory (ticked down in 5-second steps), so it survives a relog but resets on a server restart.
USB missions
Each key in Config.Reward is a usable item that starts its own mission:
Config.Reward = {
["greenusb"] = {
PosCateg = 1, -- location pool from Config.MissionPosition
NpcLevel = 1, -- weapon tier from Config.Weapons
HeadshotKill = true, -- true: NPCs die to headshots. false: they don't (hard mode)
AllItems = true, -- true: every item below, false: one random item
Peds = {"g_m_y_lost_01", "g_m_y_famca_01", "g_m_y_ballasout_01"},
items = {
{name = 'weed500g', min = 1, max = 2},
}
},
-- more colors...
}
| Field | What it does |
|---|---|
PosCateg |
Which location pool the mission draws from. |
NpcLevel |
Which weapon tier the guards get. |
HeadshotKill |
true: guards die to headshots. false: they don't. |
AllItems |
true: the player receives every entry in items. false: one random entry. |
Peds |
Ped models; each guard picks one at random. |
items |
{name, min, max} - item name and a random amount between min and max. |
Any new key becomes a usable item on the next start, as long as the item exists in your inventory. Default tiers: greenusb / whiteusb / blueusb use pool 1 and weapon tier 1; blackusb uses pool 3, tier 2 and HeadshotKill = false with a random-diamond reward; purpleusb uses pool 2 and tier 3.
Weapon tiers
Config.Weapons has three numbered pools. Every spawned guard gets one random weapon from the pool matching the USB's NpcLevel:
| Tier | Contents |
|---|---|
1 |
Pistols (weapon_pistol ... weapon_heavypistol) |
2 |
Heavy pistols, SMGs, sawn-off, special carbine |
3 |
Rifles and shotguns up to weapon_militaryrifle and weapon_combatmg |
Guards spawn with 100 armour, 60 accuracy and 700 HP (the group leader has 1100 HP). They guard the loot and attack the nearest player within range.
Location pools
Config.MissionPosition has three numbered pools. A random free location is drawn from the pool matching the USB's PosCateg:
Config.MissionPosition = {
[1] = {
{
Location = vector3(-520.12, -2877.79, 7.29), -- steal marker
InUse = false, -- DO NOT CHANGE IT
GoonSpawns = {
vector3(-523.38, -2877.98, 7.29), -- one NPC per entry
vector3(-512.69, -2867.88, 7.29),
-- ...
}
},
-- more locations...
},
[2] = { ... },
[3] = { ... },
}
| Field | What it does |
|---|---|
Location |
Where the marker and blip are placed. Players must be within 15 m of it to receive the reward. |
InUse |
Runtime flag synced to all players so two missions don't share a location. Always leave it false. |
GoonSpawns |
One guard spawns per entry. |
Default sizes: pool 1 has 35 locations, pool 2 has 1 large location with 13 guards, pool 3 has 8 locations. Give each pool enough locations for your player count - if no free location is found, the player gets the no_location text and the USB is not used up.
NPC combat tuning
Config.CombatAttributes (SetPedCombatAttributes) and Config.CombatFloats (SetCombatFloat) are applied to every guard once combat starts. The keys are GTA native combat attribute/float IDs - only change them if you know what they do.
Texts
All player-facing strings live in locales/en.lua:
| Key | Default |
|---|---|
try_later |
"You can't hack the network right now, please try again later." |
inventory_full |
"You cannot carry any more of this item." |
no_location |
"There are not available locations. Try again later." |
hack_failed |
"You could't hack the location." |
hack_success |
"You hacked the location." |
mission_blip |
"Mission Blip" |
press_to_steal |
"Press ~INPUT_CONTEXT~ to steal" |
steal_success |
"Stealing was successfull." |
connecting / stealing |
Progress bar labels |
To translate, copy en.lua to e.g. locales/de.lua with Locales['de'] = {...} and set Config.Locale = 'de'. Every file in locales/ is loaded automatically.
Open files
| File | Functions |
|---|---|
client/client_open.lua |
ClientNotification, ShowProgressBar, StartHackMinigame |
server/server_open.lua |
Usable item registration for every USB, ServerNotification, GetPlayerIdentifierVNS, PlayerHasItem, RemoveItemFromPlayer, PlayerCanCarryItem, GiveItemToPlayer |