
Faction
Factions you set up entirely in game: every faction is a real job with boss menu, garages, storages, wardrobe, elevator, level, action menu and gang war system. The script creates the tables itself.
Requirements
- ESX Legacy (
es_extended, tested with 1.14) - oxmysql
- OneSync
- For the wardrobe: skinchanger and esx_skin (or your own functions in
config/functions.lua) - For the F6 menu and the gang war vehicle menu: esxmenudefault (or your own menus via
ClientActionMenuandClientGangwarVehicleMenu)
Features
- Creator (
/fraktionen): Create factions in game with ranks, salary, vehicles, locations (marker or NPC), blips and access from a certain rank. - Boss menu: Manage members, treasury with history, buy vehicles, permissions per rank, applications and logs.
- Applications: Players apply to factions at application spots (NPC or marker from the creator), the leadership accepts or rejects in the boss menu.
- GPS: Members see each other on the map, with their own icon on foot, in a car, on a motorcycle or bicycle, in a boat, helicopter or plane, while swimming and when dead (on/off per faction).
- Faction vehicles with style: own plate prefix, paint and xenon in the faction color, max tuning and tinted windows. With a key to lock and unlock.
- Garages and storages: up to 10 each per faction, access from a certain rank.
- Wardrobe, elevator (up to 10 floors) and level with XP (on/off per faction).
- Action menu (F6): Cuff, search, identify, escort and vehicle actions, selectable per faction.
- Gang war: Create zones in game, modes Time limit and First Contact, own dimension, shop and leaderboard.
- Discord logs for all areas.
Installation
- Put the
off_factionfolder intoresources. - Add to your
server.cfgafter oxmysql and ESX:
ensure oxmysql
ensure es_extended
ensure off_faction- Open
/fraktionen, create a faction and set the leadership with/setjob <ID> <name> <rank>(highest rank = number of ranks − 1).
Job names
The faction name is also the job name (2–20 characters, a–z, 0–9, _) and is fixed after that. If the job already exists, you can't create the faction.
Configuration
config/settings/config.lua
| Option | Default | Description |
|---|---|---|
serverInfo.name | 'OFF SCRIPTS' | Server name, shown in the UI instead of "OFF SCRIPTS" |
serverInfo.locale | 'de' | Language: de, en, pl, fr, es or it |
serverInfo.color | { 155, 89, 255 } | UI color (RGB) |
serverInfo.design | 3 | UI design: 1 = Classic, 2 = Receipt, 3 = Storefront |
blur | true | Blurred background while a menu is open. The creator stays sharp (preview) |
creator.command | 'fraktionen' | Command for the creator |
creator.groups | { 'projektleitung' } | Groups for the faction creator |
creator.zoneGroups | { 'projektleitung' } | Groups for the gang war zone creator |
inviteSeconds | 60 | Seconds until an invitation expires |
storeRange | 25.0 | Max. distance when storing a vehicle (meters) |
plateFormat | 'LLL NNN' | Plate: L = letter, N = number, only applies without a prefix in the creator |
applications.cooldown / maxOpen | 24 / 3 | Hours locked after a rejection, max. open applications per player |
gps.interval / scale | 2 / 0.8 | Seconds between GPS updates, size of the blips |
gps.showSelf | true | true = you also see your own GPS blip |
gps.types | see file | sprite and color per state: foot, swim, car, bike, bicycle, boat, heli, plane, dead (default white, dead red) |
vehicleKeys.enabled / key / range | true / 'U' / 10.0 | Key system, default key, range in meters |
vehicleKeys.shared | false | true = all members can lock and unlock faction vehicles that are out |
bossLogs.days | 30 | How many days logs stay saved in the boss menu |
bossLogs.<area> | true (actions false) | Which areas the logs page shows: members, money, garage, storage, wardrobe, gangwarShop, level, actions |
levels.max / base / growth | 50 / 1000 / 1.15 | XP per level = base × growth ^ (Level − 1) |
levels.tiers | 5 tiers | With the level system: outfit slots and storage kg from a certain level |
outfitSlots | 10 | Outfit slots without the level system |
weaponWeight | 2.0 | Weight of one weapon in storage |
itemImages | off_inventory images | Image path for items in storage, %s = item name |
marker / blips | see file | Default for new locations, adjustable per location in the creator. blips.enabled = false turns off all blips |
config/settings/config.gangwar.lua
| Option | Default | Description |
|---|---|---|
times | 18:00 – 22:00 | Allowed times (server time), empty = always |
joinSeconds | 60 | First Contact: join time in the lobby. Time limit starts right away |
respawnSeconds | 10 | Seconds until respawn |
lobbyRadius | 15.0 | Size of the lobby around the spawn (meters) |
players.min / max | 1 / 0 | Players per side (min only First Contact, max = 0 = unlimited) |
killPoints | 3 | Time limit: points per kill |
modes.<mode>.duration | 25 / 15 | Duration in minutes |
cooldowns | 1 / 0 / 1 | Minutes: attack (faction break), zone (zone lock), queue (until the queue expires), 0 = off |
rewards | see file | Gang war points and XP for win, lose, draw and forfeit |
weapons | off | enabled = true: only these weapons in the gang war, your own come back afterwards |
vehicles / shop | see file | Vehicles of the gang war garages and shop items |
config/settings/config.actions.lua
| Option | Default | Description |
|---|---|---|
command / key | 'fraktionsmenu' / 'F6' | Command (/off_faction:fraktionsmenu) and default key for the action menu |
reach | 3.0 | How close a player or vehicle in front of you has to be (meters) |
search.requireCuffed | true | Only search cuffed players |
search.accounts | { 'money', 'black_money' } | Accounts that can be taken when searching |
cuffedAnims | see file | Animations ClientIsCuffed uses to detect cuffed players |
identify | see file | Display time and which fields show up for player and vehicle |
animations | see file | Animation and duration per action |
config/functions.lua
This is where you hook up your own scripts. Errors in it end up in the console, the script keeps running.
| Function | Purpose |
|---|---|
Notify(message, type) / HelpNotify(text) | Notify and help text · Server: Notify(source, message, type) |
ClientGetFuel(vehicle) / ClientSetFuel(vehicle, fuel) | Fuel script |
ClientVehicleRetrieved(vehicle, plate) | After taking out a vehicle, e.g. give keys |
ClientVehicleStored(plate) | After storing a vehicle, e.g. remove keys |
ClientGetSkin() / ClientApplyOutfit(clothes) / ClientRestoreOutfit() | Clothing script for the wardrobe |
ClientActionMenu(title, actions, onSelect) | F6 menu (default: ESX default menu) |
ClientIsCuffed() | Cuffed check when searching (your own cuffs and animations) |
ClientCuffChanged(kind) | Own cuffs on or off, e.g. lock the phone |
ClientGangwarDeath() / ClientGangwarRespawn() | Death and respawn in the gang war, e.g. hide the ambulance script |
ClientRestoreLoadout(loadout) | Give weapons in the gang war and give them back |
ClientGangwarVehicleMenu(vehicles, onSelect) | Vehicle menu of the gang war garage |
ClientGangwarVehicleSpawned(vehicle, plate) | Gang war vehicle spawned, e.g. give keys |
ServerLevelUp(faction, level) | Faction levels up |
ServerVehicleBought(faction, model, plate) | Vehicle bought |
ServerGangwarStarted(zone, attacker, defender) | Gang war starts |
ServerGangwarEnded(zone, attacker, defender, outcome) | Gang war ended (outcome from the attacker's view) |
ServerVehicleImpounded(source, plate) | Vehicle impounded, e.g. connect another garage script |
ServerCuffedDisconnect(source, xPlayer, kind, reason) | Cuffed player leaves the server, e.g. jail |
config/settings/config.server.lua and languages
Discord webhooks per area (creator, members, money, garage, storage, wardrobe, level, gangwar, actions), url = '' turns a log off. All texts are in config/locales/ (one file per language).
In game
- Creator (
/fraktionen): Create a faction, set locations with Use my position, markers, NPCs and blips via Customize, under Settings turn on the level system, garage, storage, gang war and the F6 menu actions. Only Save applies everything. At the top you switch to Applications and Gang war zones. - Adjust NPC: Pick a model from an image list of all GTA peds (search and categories), plus scenario and heading, all with live preview in game. You pick an addon ped by typing the exact model name into the search.
- Vehicle style (Creator → Vehicles): Plate prefix with up to 5 characters, e.g.
BALLAgivesBALLA 48. If the prefix changes, all faction vehicles get a new plate when you save and vehicles that are out are removed. Plus paint in the faction color, max tuning, tinted windows and xenon in the faction color. - GPS (Creator → Settings): Members see each other on the map. The icon changes depending on the state, colors and icons are in
gps.types. The blip only shows the heading on foot and while swimming, vehicle icons always stay upright. - Keys: Whoever takes out a faction vehicle can lock and unlock it with U (changeable in the FiveM key bindings). With
vehicleKeys.shared = trueall members can do that. - Applications: You create application spots in the creator under Applications (up to 20), as NPC or marker and optionally with a blip for all players. They apply to all factions. At the spot, E opens the list of all factions that accept applications, there you send a text. Your own faction isn't in the list. Members with the permission Invite members get a message and see the application in the boss menu under Members → Applications. You can also close applications there. Accepting also works when the player is offline.
- Logs (boss menu, bottom button): everything that happens in the faction, e.g. deposits and withdrawals, vehicles taken out, stored or bought, storage, wardrobe, members, applications, gang war shop and level. Gang war attacks aren't listed there. Visible to the leadership and ranks with the permission View logs.
- Locations: At the boss menu, garage, storage, wardrobe and elevator, E opens the menu.
- Action menu (F6): Works on the player or vehicle directly in front of you.
- Hard cuffs: only look around. Soft cuffs: walk, but not sprint, jump or attack. Select again to remove them.
- Search: only cuffed players, you can only take things.
- Escort: lead a cuffed player in front of you. Put in vehicle / Take out of vehicle for cuffed players.
- Vehicle: wash, repair, impound (private vehicles end up in the off_garage impound) and identify. X cancels.
- Gang war: At the gang war point, E opens the menu. One faction queues a zone, another one accepts. Join with E at the gang war point.
- Time limit: starts right away, points per kill, respawn, joining possible until the end.
- First Contact: join time in the lobby, then one life per player.
For developers
exports.off_faction:AddXP('vagos', 250)
exports.off_faction:SetLevel('vagos', 5, 0)
local level, xp, needXp = exports.off_faction:GetLevel('vagos')
local faction = exports.off_faction:GetFaction('vagos')
local list = exports.off_faction:GetFactions()
local isFaction = exports.off_faction:IsFaction('vagos')
local name, grade = exports.off_faction:GetPlayerFaction(source)
local allowed = exports.off_faction:HasPermission(source, 'withdraw')
exports.off_faction:AddBalance('vagos', 5000, 'Reward')
exports.off_faction:RemoveBalance('vagos', 5000, 'Strafe')- All exports are server-side.
- Server event
off_faction:levelUpwith(faction, level)on level up. - Statebags:
offGangwar(zone ID in the gang war),offCuffed('hard','soft'orfalse),offEscorted(server ID of the escorting player).
Common issues
On start, the script reports errors and hints in the server console.
| Problem | Solution |
|---|---|
| “An ESX job with this name already exists” | Pick a different name, existing jobs aren't taken over. |
| Nobody sees the marker or NPC | Only members see the locations. Set the position and save, check the minimum rank. |
| Wardrobe doesn't put anything on | Start skinchanger/esx_skin or adjust the clothing functions. |
| F6 doesn't open a menu | Turn on an action under Settings, start esxmenudefault. |
| Vehicle missing in the garage | Assign it to the garage in the creator under Garages. Vehicles without a garage are in all garages. If it has a price, the leadership has to buy the vehicle in the boss menu first. |
| GPS shows nobody | Turn on GPS in the creator under Settings. It only shows members who are online. |
| U doesn't lock | Only whoever took out the vehicle, or everyone with vehicleKeys.shared = true. Check the key in the FiveM key bindings. |
| Application missing in the boss menu | It only shows up in the boss menu of the faction the player applied to, and only for ranks with the permission Invite members. |
| Logs page is empty | Set the area in bossLogs to true. Entries are only created from now on, older actions aren't there. |
| “Gang wars are not allowed right now” | Time is outside of times. For always: times = {}. |
| Ambulance script revives you in the gang war | Turn off the death screen in ClientGangwarDeath. |
Not bought yet?
View Faction in the shop