Exports (Server Side)

Server-sided exports

GetGroupLeader

Returns the group leader's id.

-- Params:
-- @groupId, number - The group id
exports["bd-groups"]:GetGroupLeader(groupId)

-- Example:
local leaderSrc = exports["bd-groups"]:GetGroupLeader(1)

IsGroupLeader

Returns whether or not the player is the group leader.

-- Params:
-- @groupId, number - The group id
-- @playerSource, number - The player's id you want to check
exports["bd-groups"]:IsGroupLeader(groupId)

-- Example:
local isLeader = exports["bd-groups"]:IsGroupLeader(1, 222)

GetGroupMembers

Returns the group members by the given group id.

-- Params:
-- @groupId, number - The group id
exports["bd-groups"]:GetGroupMembers(groupId)

-- Example:
local members = exports["bd-groups"]:GetGroupMembers(1)

FindGroupByMember

Returns the group id of the group the player is in.

-- Params:
-- @playerSource, number - The player's id
exports["bd-groups"]:FindGroupByMember(playerSource)

-- Example:
local groupId = exports["bd-groups"]:FindGroupByMember(1)

GetJobStatus

Returns the job status of the group

-- Params:
-- @groupId, number - The group's id
exports["bd-groups"]:GetJobStatus(groupId)

-- Example:
local status = exports["bd-groups"]:GetJobStatus(1)

SetJobStatus

Sets the job status for the given group

-- Params:
-- @groupId, number - The group's id
-- @status, string - The status to set
exports["bd-groups"]:SetJobStatus(groupId, status)

-- Example:
exports["bd-groups"]:SetJobStatus(1, "Ammunation Robbery")

GetGroupMembersCounts

Returns the amount of members in the group

-- Params:
-- @groupId, number - The group's id
exports["bd-groups"]:GetGroupMembersCount(groupId)

-- Example:
local membersAmount = exports["bd-groups"]:GetGroupMembersCount(1)

CreateBlipForGroup

Creates a blip for everyone in the group.

-- Params:
-- @groupId, number - The group's id
-- @blipName, string - The blip name that the blip will be identified by.
-- @blipData, table - The blip data
--[[ 

local blipData = {
    coords = Jobs[groupId]['CocaineSuppliesLocation'],
    color = 37,
    alpha = 255,
    sprite = 514,
    scale = 0.62,
    label = "Cocaine Supplies",
    route = true,
    routeColor = 1,
}

]]--
exports["bd-groups"]:CreateBlipForGroup(groupId, blipName, blipData)

-- Example:
exports["bd-groups"]:CreateBlipForGroup(1, "cocaine-supplies", blipData)

RemoveBlipForGroup

Removes the blip by the given name for the group.

-- Params:
-- @groupId, number - The group's id
-- @blipName, string - The blip's name created with
exports["bd-groups"]:RemoveBlipForGroup(groupId, blipName)

-- Example:
exports["bd-groups"]:RemoveBlipForGroup(1, "cocaine-supplies")

DestroyGroup

Destroys the given group.

-- Params:
-- @groupId, number - The group's id
exports["bd-groups"]:DestroyGroup(groupId)

-- Example:
exports["bd-groups"]:DestroyGroup(1)

NotifyGroup

Sends a notification to everyone in the group.

-- Params:
-- @groupId, number - The group's id
-- @message, string - The message of the notification
-- @timeout, number - The time for the notification to dissappear (in milliseconds)
exports["bd-groups"]:NotifyGroup(groupId, message, timeout)

-- Example:
exports["bd-groups"]:NotifyGroup(1, "Rob the vault", 3000)

DoesGroupExist

Returns whether or not the given group id exists.

-- Params:
-- @groupId, number - The group's id
exports["bd-groups"]:DoesGroupExist(groupId)

-- Example:
exports["bd-groups"]:DoesGroupExist(1)

Last updated