Exports
Possibly useful exports within Wasabi Gang Wars (wasabi_gangwars) to use with 3rd party scripts or integrations.
Server Exports
GetPlayerGangData
local playerGangData = exports.wasabi_gangwars:GetPlayerGangData(source)
if not playerGangData then
print('Player not in a gang or is not online')
else
print('Gang ID: '..playerGangData.id)
print('Gang Name: '..playerGangData.name)
print('Gang Owner: '..playerGangData.owner)
print('Gang Bank: $'..playerGangData.balance)
print('Gang Member Count: '..#playerGangData.members or 0)
end
Retrieves a passed server ID's gang information.
Parameters
source : The player's server ID you wish to retrieve gang data for
Returns nil if not in gang OR a table of the player's gang information:
id= The gang ID of the gang (number).name= The gang's name (string).owner= The gang's owner (string).members= The members of the gang (array<objects>).
GetPlayerGangId
local gangId = exports.wasabi_gangwars:GetPlayerGangId(source)
if not gangId then
print('No gang or gang ID found')
else
print('Player\'s gang ID: '..gangId)
end
Returns the player's gang ID or nil if not found.
Parameters
source: Player you wish to retrieve the gang ID of.
GetGangIdByName
local gangId = exports.wasabi_gangwars:GetGangIdByName(gangName)
if not gangId then
print('failed to find any gangs by that name')
else
print('Gang ID for '..gangName..' is: '..gangId)
end
Returns the gang ID from the passed gang name or nil if not found.
Parameters
gangName: The name of the game you wish to query the ID of (String)
SendWarRequest
local warData, message = exports.wasabi_gangwars:SendWarRequest(fromGangId, toGangId, wager, killsToWin)
if not warData then
print('Failed to send war request')
if message then
print('Reason: '..message)
end
else
print('War invite sent')
end
Sends war request to a gang from another gang. Returns war data if success or nil if not.
Parameters
fromGangId: The sender of the request gang ID (number)
toGangId: The gang ID of the receiver of the war request (number)
wager: The purposed wager of the war (number)
killsToWin: The kills required to win the war (number)
isPlayerInActiveWar
local isInWar = exports.wasabi_gangwars:isPlayerInActiveWar(source)
if not isInWar then
print('The player '..source..' is not actively in a war')
end
Checks if a player is actively in a gang war. Returns false if not in war OR the war data if actively at war.
Parameters
source: The player source you wish to check if in war (number)