Exports

Server-side exports for Possible Gang Wars.

Important

The resource folder on your server must be named exactly possible_wars. Do not rename it. Exports and events use that name.

Server exports only. Call these from other server resources.

startWar

Creates an active war between two gangs and syncs it to online members.

Lua
exports['possible_wars']:startWar(gang1, gang2, wager, killTarget)

Parameters

NameTypeRequiredDescription
gang1string✅First gang name
gang2string✅Second gang name
wagernumber✅Money wager
killTargetnumber✅Kills needed to win

Returns

TypeDescription
booleanfalse if params are missing or either gang is already at war. true means the insert was accepted (DB write is async).

Example

Lua
local ok = exports['possible_wars']:startWar('ballas', 'families', 5000, 10)if not ok then    print('Could not start war')end

syncAllPlayers

Re-broadcasts every in-memory active war to online gang members (no start notification).

Lua
exports['possible_wars']:syncAllPlayers()

Parameters

None.

Returns

Nothing.

Use after bulk changes or if players missed the initial war sync.

syncWar

Loads / rebroadcasts a single active war by database id.

Lua
exports['possible_wars']:syncWar(warId)

Parameters

NameTypeRequiredDescription
warIdnumber✅possible_active_wars.id

Returns

TypeDescription
booleanfalse if warId is missing. true if already in memory (rebroadcasts) or an async DB load was started.

Example

Lua
exports['possible_wars']:syncWar(12)
JDB-NET Logo
Partner Service

Self-hosted unlimited logs with managed Grafana

JDB-NET provides a self-hosted solution with unlimited logs, a fully managed Grafana instance, and unlimited users. Perfect for FiveM servers that need comprehensive logging and monitoring.

Check out JDB-NET