Server
This page lists all the available server-side events and exports.
Events (General)
List of general events.
Increase Loyalty
This event increases loyalty in the zone based on a specified action for the gang the specified player is a member of.
Example code
TriggerEvent('rcore_gangs:server:increase_loyalty', src, action, modifier)Parameter:
src:
numbernumber: The source of the player (server identifier)
action:
stringstring: The action that occurred (defined in Config.IncreaseMultipliers)
modifier:
numbernumber: The modifier that additionally changes how much loyalty is added
Decrease Loyalty
This event decreases loyalty in the zone based on a specified action for the gang the specified player is a member of.
Example code
TriggerEvent('rcore_gangs:server:decrease_loyalty', src, action, modifier)Parameter:
src:
numbernumber: The source of the player (server identifier)
action:
stringstring: The action that occurred (defined in Config.DecreaseMultipliers)
modifier:
numbernumber: The modifier that additionally changes how much loyalty is removed
Exports (General)
List of general exports.
GetPlayerGang
This export returns the gang the specified player is a member of.
Example code
exports['rcore_gangs']:GetPlayerGang(src)Parameter:
src:
numbernumber: The source of the player (server identifier)
Return:
gang?:
tableid:
numbernumber: The id of the gang
tag:
stringstring: The gang tag
name:
stringstring: The gang name
color:
stringstring: The gang color
identifier:
numberorstringnumber: The identifier of the gang leaderstring: The identifier of the gang leader
members:
table[]table: The list of all gang membersname:
stringstring: The ingame character name of the gang member
rank:
stringstring: The rank of the gang member
access:
booleanboolean: Whether or not the gang member has priviliged rank
identifier:
numberorstringnumber: The identifier of the gang memberstring: The identifier of the gang member
vehicles:
table[]table: The list of all gang vehiclesmodel:
numbernumber: The model hash of the gang vehicle
color:
numbernumber: The color index of the gang vehicle
garage?:
vec3vec3: The position of the gang garage
storage?:
vec3vec3: The position of the gang storage
rank:
stringstring: The rank of the specified player in the gang
access:
booleanboolean: Whether or not the specified player has priviliged rank
superaccess:
booleanboolean: Whether or not the specified player is the leader of the gang
GetGangAtZone
This export returns the gang which controls the specified zone.
Example code
exports['rcore_gangs']:GetGangAtZone(zone)Parameter:
zone:
tabletable: The zone object obtained by usingGetZoneAtPositionexport
Return:
gang?:
tableid:
numbernumber: The id of the gang
tag:
stringstring: The gang tag
name:
stringstring: The gang name
color:
stringstring: The gang color
identifier:
numberorstringnumber: The identifier of the gang leaderstring: The identifier of the gang leader
members:
table[]table: The list of all gang membersname:
stringstring: The ingame character name of the gang member
rank:
stringstring: The rank of the gang member
access:
booleanboolean: Whether or not the gang member has priviliged rank
identifier:
numberorstringnumber: The identifier of the gang memberstring: The identifier of the gang member
vehicles:
table[]table: The list of all gang vehiclesmodel:
numbernumber: The model hash of the gang vehicle
color:
numbernumber: The color index of the gang vehicle
garage?:
vec3vec3: The position of the gang garage
storage?:
vec3vec3: The position of the gang storage
GetZoneAtPosition
This export returns the gang zone located in the specified position.
Example code
exports['rcore_gangs']:GetZoneAtPosition(position)Parameter:
position:
vec3vec3: The position of the zone
Return:
zone?:
tablename:
stringstring: The name of the zone
label:
stringstring: The label of the zone
neighbors:
table[]table: The list of all the neighboring zones
drugPreference:
tabletable: The multipliers for each drug category in the zoneCATEGORY_LOW:
number:number: The multiplier for low drug category
CATEGORY_MED:
number:number: The multiplier for medium drug category
CATEGORY_HIGH:
number:number: The multiplier for high drug category
IsPlayerBagged
This export returns whether the specified player has paper bag on or not.
Example code
exports['rcore_gangs']:IsPlayerBagged(src)Parameter:
src:
numbernumber: The source of the player (server identifier)
Return:
check:
booleanboolean: Whether or not the player has paper bag on
IsPlayerRestrained
This export returns whether the specified player has zip ties on or not.
Example code
exports['rcore_gangs']:IsPlayerRestrained(src)Parameter:
src:
numbernumber: The source of the player (server identifier)
Return:
check:
booleanboolean: Whether or not the player has zip ties on
IsPlayerEscorted
This export returns whether the specified player is being escorted or not.
Example code
exports['rcore_gangs']:IsPlayerEscorted(src)Parameter:
src:
numbernumber: The source of the player (server identifier)
Return:
check:
booleanboolean: Whether or not the player is being escorted
Exports (Management)
List of management exports.
CreateGang
This export creates a new gang based on the specified parameters.
Example code
exports['rcore_gangs']:CreateGang(playerId, colorId, group, tag, name)Parameter:
playerId:
numberorstringnumber: The source of the player (server identifier)string: The identifier of the player (server database)
colorId:
stringstring: The color of the gang
group:
stringstring: The rank group of the gang
tag:
stringstring: The tag of the gang
name:
stringstring: The name of the gang
Return:
message?:
stringstring: The error message if the export failed
DeleteGang
This export deletes an existing gang based on the specified parameters.
Example code
exports['rcore_gangs']:DeleteGang(gangId)Parameter:
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
AddMember
This export adds a new member to an existing gang based on the specified parameters.
Example code
exports['rcore_gangs']:AddMember(playerId, gangId)Parameter:
playerId:
numberorstringnumber: The source of the player (server identifier)string: The identifier of the player (server database)
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
KickMember
This export kicks a member from an existing gang based on the specified parameters.
Example code
exports['rcore_gangs']:KickMember(playerId, gangId)Parameter:
playerId:
numberorstringnumber: The source of the player (server identifier)string: The identifier of the player (server database)
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
SetMemberRank
This export changes the rank of a member from an existing gang based on the specified parameters.
Example code
exports['rcore_gangs']:SetMemberRank(playerId, rank, gangId)Parameter:
playerId:
numberorstringnumber: The source of the player (server identifier)string: The identifier of the player (server database)
rank:
numberorstringnumber: The table index of the rank (defined in Config.GangRanks)string: The name of the rank (defined in Config.GangRanks)
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
SetMemberLeader
This export transfers the leadership from the leader to a member from an existing gang based on the specified parameters.
Example code
exports['rcore_gangs']:SetMemberLeader(playerId, gangId)Parameter:
playerId:
numberorstringnumber: The source of the player (server identifier)string: The identifier of the player (server database)
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
LeaveGang
This export makes a member leave an existing gang based on the specified parameters.
Example code
exports['rcore_gangs']:LeaveGang(playerId, gangId)Parameter:
playerId:
numberorstringnumber: The source of the player (server identifier)string: The identifier of the player (server database)
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
DisbandGang
This export makes the leader disband an existing gang based on the specified parameters.
Example code
exports['rcore_gangs']:DisbandGang(playerId, gangId)Parameter:
playerId:
numberorstringnumber: The source of the player (server identifier)string: The identifier of the player (server database)
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
AddCheckpoint
This export adds a new checkpoint to an existing gang based on the specified parameters.
Example code
exports['rcore_gangs']:AddCheckpoint(checkpoint, position, gangId)Parameter:
checkpoint:
stringstring: The checkpoint type to addGARAGEorSTORAGE
position:
vec3vec3: The position of the checkpoint
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
RemoveCheckpoint
This export removes an existing checkpoint from an existing gang based on the specified parameters.
Example code
exports['rcore_gangs']:RemoveCheckpoint(checkpoint, gangId)Parameter:
checkpoint:
stringstring: The checkpoint type to removeGARAGEorSTORAGE
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
AddVehicle
This export adds a new vehicle to an existing gang garage based on the specified parameters.
Example code
exports['rcore_gangs']:AddVehicle(model, color, gangId)Parameter:
model:
numberorstringnumber: The model hash of the vehiclestring: The model name of the vehicle
color:
numbernumber: The color index of the vehicle (defined in Config.VehicleColors)
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
RemoveVehicle
This export removes an existing vehicle from an existing gang garage based on the specified parameters.
Example code
exports['rcore_gangs']:RemoveVehicle(model, color, gangId)Parameter:
model:
numberorstringnumber: The model hash of the vehiclestring: The model name of the vehicle
color:
numbernumber: The color index of the vehicle (defined in Config.VehicleColors)
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
AddBalance
This export adds money to an existing gang reserve based on the specified parameters.
Example code
exports['rcore_gangs']:AddBalance(amount, gangId)Parameter:
amount:
numbernumber: The amount to be added
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
RemoveBalance
This export removes money from an existing gang reserve based on the specified parameters.
Example code
exports['rcore_gangs']:RemoveBalance(amount, gangId)Parameter:
amount:
numbernumber: The amount to be removed
gangId:
numberorstringnumber: The id of the gangstring: The tag/name of the gang
Return:
message?:
stringstring: The error message if the export failed
Last updated
Was this helpful?