Exports
Server-side exports for Possible Gang Wars.
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.
exports['possible_wars']:startWar(gang1, gang2, wager, killTarget)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
gang1 | string | ✅ | First gang name |
gang2 | string | ✅ | Second gang name |
wager | number | ✅ | Money wager |
killTarget | number | ✅ | Kills needed to win |
Returns
| Type | Description |
|---|---|
boolean | false if params are missing or either gang is already at war. true means the insert was accepted (DB write is async). |
Example
local ok = exports['possible_wars']:startWar('ballas', 'families', 5000, 10)if not ok then print('Could not start war')endlocal ok = exports['possible_wars']:startWar('ballas', 'families', 5000, 10)if not ok then print('Could not start war')endlocal ok = exports['possible_wars']:startWar('ballas', 'families', 5000, 10)if not ok then print('Could not start war')endsyncAllPlayers
Re-broadcasts every in-memory active war to online gang members (no start notification).
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.
exports['possible_wars']:syncWar(warId)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
warId | number | ✅ | possible_active_wars.id |
Returns
| Type | Description |
|---|---|
boolean | false if warId is missing. true if already in memory (rebroadcasts) or an async DB load was started. |
Example
exports['possible_wars']:syncWar(12)