😡
RAINMAD Documentation
WebsiteStoreDiscordYouTube
  • Welcome to RAINMAD Scripts
  • INFORMATION
    • FAQ
    • Support and Assistance
    • Discord Roles
    • How to Update Your Asset
  • CFX Auth system
    • FiveM Asset Escrow System
  • Development Guide
    • Common Issues
    • How to Add Webhooks
    • Target Options Configuration
    • How to Translate Your Script
    • How to Integrate Your Custom Notification Script
    • How to Change the Black Money Name
    • How to Add an Item
    • How to Change the Dispatch
    • Framework Selection and Configuration
    • Finding Item Images
  • RESOURCES
    • Cargo Ship Heist
      • Installation
      • Dependencies
      • Translate Strings
      • Discord Log
      • Configuration
      • Exports
    • Below the Vault Heist
      • Installation
    • NPC Mechanic
      • Installation
      • Configuration Guide
    • Cash Exchange Heist
      • Installation
      • Dependencies
    • Drugs V: Grow, Cook & Space!
      • Installation
      • Configuration Guide
    • Drugs V: Laboratories
      • Installation
      • Configuration Guide
    • Drugs V: Goods Deal
      • Installation
      • Configuration Guide
    • Drugs V: Business Labs
      • Installation
      • Configuration Guide
    • Drugs V: Effects
      • Installation
      • Configuration Guide
      • Exports
    • Drugs V: Money Laundering
      • Installation
      • Configuration Guide
    • Bank Truck Robbery - 4 in 1!
      • Installation
      • Dependencies
      • Translate Strings
      • Discord Log
      • Events & Exports
      • Disable Mission NPC
    • House Robbery with Welding Minigame
      • Installation
      • Dependencies
      • Inventory Integration
      • Translate Strings
      • Discord Log
      • Creating a House for Robbery
      • Events & Exports
      • Disable Mission NPC
    • Lootbag
      • Installation
    • Bounty Board
      • Installation
    • Chopshop with Welding Minigame
      • Installation
      • Dependencies
      • Translate Strings
      • Discord Log
      • Events & Exports
      • Disable Mission NPC
    • Scenes: Draw everywhere
      • Installation
      • Add Text Font
      • Events & Exports
    • Vault Heist
      • Installation
      • Vehicle Mods
      • Dependencies
    • Barge Heist
      • Installation
      • Dependencies
    • Towtruck + Missions
      • Installation
    • Zombies & Dungeon
      • Installation
      • Rarity System
    • Gangs - Territory, Wars & Tribute Zones!
      • Installation
      • Add Gang & Tribute Zone
      • Events & Exports
      • Gang System for ESX
    • Camper V: Drug Caravans
      • Installation
      • Dependencies
    • Realistic Airdrop
      • Installation
    • ATM Robbery - 4 in 1!
      • Installation
    • Bobcat Security Heist
      • Installation
      • Dependencies
    • Minigame Bundle
      • Installation
      • Minigame Exports
      • Translate Strings
    • Weapon V: Realism
      • Installation
    • Boombox with Watch Party
      • Installation
      • Youtube API Key
      • Exports
    • Drop and Dead Info.
      • Installation
    • Throw Everything
      • Installation
      • Useable Items
      • Exports
      • QBCore Compatibility
      • ESX Compatibility
    • Police Riot with Interior
      • Installation
      • Dependencies
    • Dialog with NPC
      • Installation
    • Gun Store Heist
      • Installation
      • Dependencies
    • Emoji V: Share Feelings
      • Installation
    • Illegal Corners: Selling Goods
      • Installation
      • Adding a New Corner
    • Decal V: Graffiti & Vehicle Sticker
      • Installation
      • Custom Decal
      • Events & Exports
    • Hacker V: Become Hacker
      • Installation
      • Custom Hack
      • Functions & Events
    • Weed Shop Heist
      • Installation
      • Dependencies
    • Jailbreak
      • Installation
      • Dependencies
    • Vangelico Heist Final
      • Installation
      • Dependencies
    • Pets
      • Installation
      • QBCore Compatible
    • Artifact Heist
      • Installation
    • Betta Heist
      • Installation
    • Oil Rig Heist
      • Installation
      • Dependencies
    • Fleeca Heist Final
      • Installation
      • Dependencies
    • Deluxe Car Heist
      • Installation
    • Yacht Heist
      • Installation
    • Paleto Heist
      • Installation
    • Union Heist
      • Installation
    • Shop Robbery
      • Installation
    • Drug Boat Heist
      • Installation
    • Underground Heist
      • Installation
      • Dependencies
    • Van Heist
      • Installation
      • Dependencies
    • Pacific Heist
      • Installation
      • Dependencies
    • Train Heist
      • Installation
    • Humane Labs Heist
      • Installation
    • Vangelico Heist
      • Installation
    • Fleeca Heist
      • Installation
    • Casino Heist
      • Installation
      • Dependencies
      • Compatible For Rcore
    • Art Heist
      • Installation
      • Dependencies
    • Kidnapping
      • Installation
    • Graffiti War
      • Installation
Powered by GitBook
On this page
  • Server Events
  • Exports
  • Client Exports
  • Server Exports
  1. RESOURCES
  2. Gangs - Territory, Wars & Tribute Zones!

Events & Exports

Server Events

rm_gangs:client:onGangMoneySet

AddEventHandler('rm_gangs:client:onGangMoneySet', function(data)
    print(data.gangName)
    print(data.newAmount)
end)
Key
Type
Description

gangName

string

The name of the gang whose money was set.

newAmount

number

The updated amount of gang money.

rm_gangs:client:onGangMoneyAdded

AddEventHandler('rm_gangs:client:onGangMoneyAdded', function(data)
    print(data.gangName)
    print(data.newAmount)
end)
Key
Type
Description

gangName

string

The name of the gang whose money was set.

newAmount

number

The updated amount of gang money.

rm_gangs:client:onGangMoneyRemoved

AddEventHandler('rm_gangs:client:onGangMoneyRemoved', function(data)
    print(data.gangName)
    print(data.newAmount)
end)
Key
Type
Description

gangName

string

The name of the gang whose money was set.

newAmount

number

The updated amount of gang money.

rm_gangs:server:onTributeEventStarted

AddEventHandler('rm_gangs:server:onTributeEventStarted', function(data)
    print(data.name)
    print(data.label)
    print(data.finishDate)
    print(data.paymentAmount)
    print(data.captureDuration)
    print(data.coords)
    print(json.encode(data.territory, {indent = true}))
    print(data.oldOwnerName)
    print(data.oldOwnerLabel)
end)
Key
Type
Description

name

string

Tribute zone name in cfg file

label

string

Tribute zone label in cfg file

finishDate

number

Timestamp of the event end date

paymentAmount

number

Money that can be received during the time interval set in the cfg file

captureDuration

number

Event duration in the cfg file

coords

vec4

Coordinate of the tribute npc in the cfg file

territory

table

Tribute territory data in cfg file

oldOwnerName

string or nil

Name of the group that owned the tribute territory before the war

oldOwnerLabel

string or nil

Label of the group that owned the tribute territory before the war

rm_gangs:server:onTributeEventFinished

AddEventHandler('rm_gangs:server:onTributeEventFinished', function(data)
    print(data.name)
    print(data.label)
    print(data.paymentAmount)
    print(data.captureDuration)
    print(data.coords)
    print(json.encode(data.territory, {indent = true}))
    print(data.ownerName)
    print(data.ownerLabel)
    print(data.captureDate)
    print(data.oldOwnerName)
    print(data.oldOwnerLabel)
end)
Key
Type
Description

name

string

Tribute zone name in cfg file

label

string

Tribute zone label in cfg file

paymentAmount

number

Money that can be received during the time interval set in the cfg file

captureDuration

number

Event duration in the cfg file

coords

vec4

Coordinate of the tribute npc in the cfg file

territory

table

Tribute territory data in cfg file

ownerName

string or nil

Name of the new owner of the zone

ownerLabel

string or nil

Label of the new owner of the zone

captureDate

number or nil

Timestamp of the claim date

oldOwnerName

string or nil

Name of the group that owned the tribute territory before the war

oldOwnerLabel

string or nil

Label of the group that owned the tribute territory before the war

rm_gangs:server:onTurfWarStarted

AddEventHandler('rm_gangs:server:onTurfWarStarted', function(data)
    print(data.id)
    print(data.initiatorName)
    print(data.initiatorLabel)
    print(data.targetName)
    print(data.targetLabel)
    print(data.startDate)
    print(data.finishDate)
end)
Key
Type
Description

id

number

Turf war id

initiatorName

string

Name of the group that started turf war

initiatorLabel

string

Label of the group that started turf war

targetName

string

Name of the group that owns the turf

targetLabel

string

Label of the group that owns the turf

startDate

number

Timestamp of the start date of turf war

finishDate

number

Timestamp of the end date of turf war

rm_gangs:server:onTurfWarFinished

AddEventHandler('rm_gangs:server:onTurfWarFinished', function(data)
    print(data.id)
    print(data.initiatorName)
    print(data.initiatorLabel)
    print(data.targetName)
    print(data.targetLabel)
    print(data.startDate)
    print(data.finishDate)
    print(data.initiatorNewLoyalty)
    print(data.initiatorPersonCount)
    print(data.targetNewLoyalty)
    print(data.targetPersonCount)
    print(data.successful)
end)
Key
Type
Description

id

number

Turf war id

initiatorName

string

Name of the group that started turf war

initiatorLabel

string

Label of the group that started turf war

targetName

string

Name of the group that owns the turf

targetLabel

string

Label of the group that owns the turf

startDate

number

Timestamp of the start date of turf war

finishDate

number

Timestamp of the end date of turf war

initiatorNewLoyalty

number

New loyalty points for the group that started the turf war

initiatorPersonCount

number

Number of people alive at the end of the battle for the group that started the turf war

targetNewLoyalty

number

Turf owner's new loyalty points

targetPersonCount

number

Turf owner's number of people alive at the end of the turf war

successful

boolean

Winning status of the side that started the turf war

rm_gangs:server:onWarReplied

AddEventHandler('rm_gangs:server:onWarReplied', function(data)
    print(data.id)
    print(data.initiatorName)
    print(data.initiatorLabel)
    print(data.initiatorIdentifier)
    print(data.initiatorScore)
    print(data.targetName)
    print(data.targetLabel)
    print(data.targetIdentifier)
    print(data.targetScore)
    print(data.killGoal)
    print(data.wager)
    print(data.declareDate)
    print(data.acceptRejectDate)
    if data.accepted then
        print('accepted')
    else
        print('rejected')
    end
end)
Key
Type
Description

id

number

War id

initiatorName

string

Name of the group that declared the war

initiatorLabel

string

Label of the group that started war

initiatorIdentifier

string

Identifier of the leader of the group that started the war

initiatorScore

number

Score of the group that started the war

targetName

string

Name of the group that is the target of the war declaration

targetLabel

string

Label of the group being declared war on

targetIdentifier

string

Identifier of the leader of the group declared at war

targetScore

number

Score of the declared war group

killGoal

number

The killing goal of war

wager

number

The amount of money set as a wager

accepted

boolean

Indicates whether the group declared upon has accepted the war

declareDate

number

Timestamp of the declare date of war

acceptRejectDate

number

Timestamp of the reply date of war

rm_gangs:server:onWarFinished

AddEventHandler('rm_gangs:server:onWarFinished', function(data)
    print(data.id)
    print(data.initiatorName)
    print(data.initiatorLabel)
    print(data.initiatorIdentifier)
    print(data.initiatorScore)
    print(data.initiatorNewLoyalty)
    print(data.targetName)
    print(data.targetLabel)
    print(data.targetIdentifier)
    print(data.targetScore)
    print(data.targetNewLoyalty)
    print(data.killGoal)
    print(data.wager)
    print(data.declareDate)
    print(data.acceptRejectDate)
    print(data.finishDate)
end)
Key
Type
Description

id

number

War id

initiatorName

string

Name of the group that declared the war

initiatorLabel

string

Label of the group that started war

initiatorIdentifier

string

Identifier of the leader of the group that started the war

initiatorScore

number

Score of the group that started the war

initiatorNewLoyalty

number

New loyalty point of the group that started the war

targetName

string

Name of the group that is the target of the war declaration

targetLabel

string

Label of the group being declared war on

targetIdentifier

string

Identifier of the leader of the group declared at war

targetScore

number

Score of the declared war group

targetNewLoyalty

number

New loyalty point of the declared war group

killGoal

number

The killing goal of war

wager

number

The amount of money set as a wager

declareDate

number

Timestamp of the declare date of war

acceptRejectDate

number

Timestamp of the reply date of war

finishDate

number

Timestamp of the date the war ended

Client Events

rm_gangs:client:onTributeEventStarted

RegisterNetEvent('rm_gangs:client:onTributeEventStarted', function(data)
    print(data.name)
    print(data.label)
    print(data.finishDate)
    print(data.paymentAmount)
    print(data.captureDuration)
    print(data.coords)
    print(json.encode(data.territory, {indent = true}))
    print(data.oldOwnerName)
    print(data.oldOwnerLabel)
end)
Key
Type
Description

name

string

Tribute zone name in cfg file

label

string

Tribute zone label in cfg file

finishDate

number

Timestamp of the event end date

paymentAmount

number

Money that can be received during the time interval set in the cfg file

captureDuration

number

Event duration in the cfg file

coords

vec4

Coordinate of the tribute npc in the cfg file

territory

table

Tribute territory data in cfg file

oldOwnerName

string or nil

Name of the group that owned the tribute territory before the war

oldOwnerLabel

string or nil

Label of the group that owned the tribute territory before the war

rm_gangs:client:onTributeEventFinished

RegisterNetEvent('rm_gangs:client:onTributeEventFinished', function(data)
    print(data.name)
    print(data.label)
    print(data.paymentAmount)
    print(data.captureDuration)
    print(data.coords)
    print(json.encode(data.territory, {indent = true}))
    print(data.ownerName)
    print(data.ownerLabel)
    print(data.captureDate)
    print(data.oldOwnerName)
    print(data.oldOwnerLabel)
end)
Key
Type
Description

name

string

Tribute zone name in cfg file

label

string

Tribute zone label in cfg file

paymentAmount

number

Money that can be received during the time interval set in the cfg file

captureDuration

number

Event duration in the cfg file

coords

vec4

Coordinate of the tribute npc in the cfg file

territory

table

Tribute territory data in cfg file

ownerName

string or nil

Name of the new owner of the zone

ownerLabel

string or nil

Label of the new owner of the zone

captureDate

number or nil

Timestamp of the claim date

oldOwnerName

string or nil

Name of the group that owned the tribute territory before the war

oldOwnerLabel

string or nil

Label of the group that owned the tribute territory before the war

rm_gangs:client:onTurfWarStarted

RegisterNetEvent('rm_gangs:client:onTurfWarStarted', function(data)
    print(data.id)
    print(data.initiatorName)
    print(data.initiatorLabel)
    print(data.targetName)
    print(data.targetLabel)
    print(data.startDate)
    print(data.finishDate)
end)
Key
Type
Description

id

number

Turf war id

initiatorName

string

Name of the group that started turf war

initiatorLabel

string

Label of the group that started turf war

targetName

string

Name of the group that owns the turf

targetLabel

string

Label of the group that owns the turf

startDate

number

Timestamp of the start date of turf war

finishDate

number

Timestamp of the end date of turf war

rm_gangs:client:onTurfWarFinished

RegisterNetEvent('rm_gangs:client:onTurfWarFinished', function(data)
    print(data.id)
    print(data.initiatorName)
    print(data.initiatorLabel)
    print(data.targetName)
    print(data.targetLabel)
    print(data.startDate)
    print(data.finishDate)
    print(data.initiatorNewLoyalty)
    print(data.initiatorPersonCount)
    print(data.targetNewLoyalty)
    print(data.targetPersonCount)
    print(data.successful)
end)
Key
Type
Description

id

number

Turf war id

initiatorName

string

Name of the group that started turf war

initiatorLabel

string

Label of the group that started turf war

targetName

string

Name of the group that owns the turf

targetLabel

string

Label of the group that owns the turf

startDate

number

Timestamp of the start date of turf war

finishDate

number

Timestamp of the end date of turf war

initiatorNewLoyalty

number

New loyalty points for the group that started the turf war

initiatorPersonCount

number

Number of people alive at the end of the battle for the group that started the turf war

targetNewLoyalty

number

Turf owner's new loyalty points

targetPersonCount

number

Turf owner's number of people alive at the end of the turf war

successful

boolean

Winning status of the side that started the turf war

rm_gangs:client:onWarReplied

RegisterNetEvent('rm_gangs:client:onWarReplied', function(data)
    print(data.id)
    print(data.initiatorName)
    print(data.initiatorLabel)
    print(data.initiatorIdentifier)
    print(data.initiatorScore)
    print(data.targetName)
    print(data.targetLabel)
    print(data.targetIdentifier)
    print(data.targetScore)
    print(data.killGoal)
    print(data.wager)
    print(data.declareDate)
    print(data.acceptRejectDate)
    if data.accepted then
        print('accepted')
    else
        print('rejected')
    end
end)
Key
Type
Description

id

number

War id

initiatorName

string

Name of the group that declared the war

initiatorLabel

string

Label of the group that started war

initiatorIdentifier

string

Identifier of the leader of the group that started the war

initiatorScore

number

Score of the group that started the war

targetName

string

Name of the group that is the target of the war declaration

targetLabel

string

Label of the group being declared war on

targetIdentifier

string

Identifier of the leader of the group declared at war

targetScore

number

Score of the declared war group

killGoal

number

The killing goal of war

wager

number

The amount of money set as a wager

accepted

boolean

Indicates whether the group declared upon has accepted the war

declareDate

number

Timestamp of the declare date of war

acceptRejectDate

number

Timestamp of the reply date of war

rm_gangs:client:onWarFinished

RegisterNetEvent('rm_gangs:client:onWarFinished', function(data)
    print(data.id)
    print(data.initiatorName)
    print(data.initiatorLabel)
    print(data.initiatorIdentifier)
    print(data.initiatorScore)
    print(data.initiatorNewLoyalty)
    print(data.targetName)
    print(data.targetLabel)
    print(data.targetIdentifier)
    print(data.targetScore)
    print(data.targetNewLoyalty)
    print(data.killGoal)
    print(data.wager)
    print(data.declareDate)
    print(data.acceptRejectDate)
    print(data.finishDate)
end)
Key
Type
Description

id

number

War id

initiatorName

string

Name of the group that declared the war

initiatorLabel

string

Label of the group that started war

initiatorIdentifier

string

Identifier of the leader of the group that started the war

initiatorScore

number

Score of the group that started the war

initiatorNewLoyalty

number

New loyalty point of the group that started the war

targetName

string

Name of the group that is the target of the war declaration

targetLabel

string

Label of the group being declared war on

targetIdentifier

string

Identifier of the leader of the group declared at war

targetScore

number

Score of the declared war group

targetNewLoyalty

number

New loyalty point of the declared war group

killGoal

number

The killing goal of war

wager

number

The amount of money set as a wager

declareDate

number

Timestamp of the declare date of war

acceptRejectDate

number

Timestamp of the reply date of war

finishDate

number

Timestamp of the date the war ended

Exports

Client Exports

getPlayerGangInfo

exports.rm_gangs:getPlayerGangInfo()

--Example:
local playerGang = exports.rm_gangs:getPlayerGangInfo()
print(playerGang)

getCurrentGangZone

exports.rm_gangs:getCurrentGangZone()

--Example:
local zone = exports.rm_gangs:getCurrentGangZone()
if zone then
    print(zone.name)
    print(zone.label)
    print(zone.color)
    print(zone.loyalty)
    print(zone.territory)
    print(zone.logoURL)
else
    print('current gang zone is nil')
end

getCurrentTributeZone

exports.rm_gangs:getCurrentTributeZone()

--Example:
local tributeZone = exports.rm_gangs:getCurrentTributeZone()
if tributeZone then
    print(zone.name)
    print(zone.label)
    print(zone.paymentAmount)
    print(zone.territory)
    print(zone.owner)
    print(zone.captureDate)
    print(zone.captureTimerLabel)
    print(zone.paymentResetTime)
else
    print('current tribute zone is nil')
end

Server Exports

getGangTributeZones

exports.rm_gangs:getGangTributeZones(gangName --[[string]])

--Example:
local ownedZones = exports.rm_gangs:getGangTributeZones('ballas')
if ownedZones then
   for i=1, #ownedZones do
        print(ownedZones[i].name)
        print(ownedZones[i].label)
        print(ownedZones[i].paymentAmount)
        print(ownedZones[i].territory)
        print(ownedZones[i].owner)
        print(ownedZones[i].captureDate)
    end
else
    print('no owned zone')
end

addLoyalty

exports.rm_gangs:addLoyalty(gangName --[[string]], amount --[[number]])

removeLoyalty

exports.rm_gangs:removeLoyalty(gangName --[[string]], amount --[[number]])

cancelTributeEvent

exports.rm_gangs:cancelTributeEvent(zoneName --[[string]])
PreviousAdd Gang & Tribute ZoneNextGang System for ESX

Last updated 2 months ago