Exports
Get Player Gang
-- returns nil if not a gang member or a table with the gang and player info
local gang = exports['av_gangs']:getGang()
if gang then
print(json.encode(gang, {indent = true})
end
Get Current Zone
-- returns nil is not inside a zone or the gang that controls the zone
local zone = exports['av_gangs']:getZone()
if zone then print(zone) end
Is Player Zone
-- returns true if the current zone belongs to his gang or false
local myZone = exports['av_gangs']:myZone()
if myZone then
print("Is my territory")
else
print("Territory belongs to a rival gang")
end
Get Permissions
-- returns a table with the player permissions or false if not a gang member
local permissions = exports['av_gangs']:getPermissions()
if permissions then
print(json.encode(permissions, {indent = true})
end
Get Interior Info
-- If the player is inside a property it will return a table with the property info, returns nill if is outside
local propertyInfo = exports['av_gangs']:getInterior()
if propertyInfo then
print(json.encode(propertyInfo, {indent = true}))
end
Get Player Gang
-- returns a table with gang and player info or null if not a gang member
local src = source
local myGang = exports['av_gangs']:getGang(src)
if myGang then
print(json.encode(myGang, {indent = true}))
end
Get Gang Info
-- Returns a table with the gang main info or false if doesn't exists
local gang = "Los Santos Vagos"
local info = exports['av_gangs']:getGangByName(gang)
if info then
print(json.encode(info, {indent = true}))
end
Register Gang
-- Returns false if the gang already exists or true to confirm it was created.
-- boss is the player id to set as boss or send false
local name = "Los Santos Vagos"
local boss = source
local res = exports['av_gangs']:registerGang(name,source)
if res then
print("Gang registered!")
end
Set Gang Boss
-- returns true or false
local src = source
local gang = "Los Santos Vagos"
local res = exports['av_gangs']:setBoss(gang,src)
if res then
print("added as boss!")
end
Get Gangs Names
-- Returns a table with all gang names (NOT labels)
local allGangs = exports['av_gangs']:getGangNames()
print(json.encode(allGangs, {indent = true}))
Get Gang Graffitis
-- Returns the amount of gang graffitis
local gang = "Los Santos Vagos"
local graffitis = exports['av_gangs']:getGraffitis(gang)
print(graffitis)
Add Gang XP
-- Adds XP to the gang
-- You can skip the daily limit if you send true as 3rd argument
local gang = "Los Santos Vagos"
local toAdd = 500
local skipDaily = true
local added = exports['av_gangs']:addXP(gang,toAdd,skipDaily)
if added then
print("XP added")
else
print("Gang doesn't exist")
end
Remove Gang XP
-- Removes XP to the gang
local gang = "Los Santos Vagos"
local toRemove = 200
local removed = exports['av_gangs']:removeXP(gang,toRemove)
if removed then
print("XP Removed")
else
print("Gang doesn't exist")
end
Get Gang XP
-- Returns the player influence points
-- If u want the level divide the value by Config.LevelXP (2500 by default)
local gang = "Los Santos Vagos"
local influence = exports['av_gangs']:getGangXP(gang)
local level = 0
if influence and influence > 0 then
level = math.floor((influence / 2500))
end
Get Gang Members
-- Returns a table with all players info from a gang or false
local gang = "Los Santos Vagos"
local members = exports['av_gangs']:getMembers(gang)
if members then
print(json.encode(members, {indent = true}))
end
Last updated