Sends a computer notification to the players. Computer must be opened in order for the notification to be shown.
-- Params:
-- @source, number - The player id
-- @message, string - The message the player will see
-- @type, string - "success", "error"
exports["bd-computer"]:SendComputerNotification(source, message, type)
-- Example:
exports["bd-computer"]:SendComputerNotification(1, "You have failed the heist!", "error")
ResetContractProgress
Resets the progress of the contract id passed as an argument.
-- Params:
-- @contractId, number - The contract id in the database
exports["bd-computer"]:ResetContractProgress(contractId)
-- Example:
exports["bd-computer"]:ResetContractProgress(1)
IsPlayerInStrain
Returns whether or not a player is in a strain/gang.
-- Params:
-- @source, number - The player id
exports["bd-computer"]:IsPlayerInStrain(source)
-- Example:
local isInStrain = exports["bd-computer"]:IsPlayerInStrain(1)
GetPlayerStrain
Returns the strain/gang data of the player if is one. If the player isn't in a strain/gang, returns false.
-- Params:
-- @source, number - The player id
exports["bd-computer"]:GetPlayerStrain(source)
-- Example:
local strainData = exports["bd-computer"]:GetPlayerStrain(1)
GetPlayerStrainUsername
Returns the players username in his strain/gang. If not in a strain/gang, returns false.
-- Params:
-- @source, number - The player id
exports["bd-computer"]:GetPlayerStrainUsername(source)
-- Example:
local username = exports["bd-computer"]:GetPlayerStrainUsername(1)
GetGroupLeader
Returns the group leader's id.
-- Params:
-- @groupId, number - The group id
exports["bd-computer"]:GetGroupLeader(groupId)
-- Example:
local leaderSrc = exports["bd-computer"]: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-computer"]:IsGroupLeader(groupId)
-- Example:
local isLeader = exports["bd-computer"]:IsGroupLeader(1, 222)
GetGroupMembers
Returns the group members by the given group id.
-- Params:
-- @groupId, number - The group id
exports["bd-computer"]:GetGroupMembers(groupId)
-- Example:
local members = exports["bd-computer"]:GetGroupMembers(1)
FindGroupByMember
Returns the group id of the group the player is in.
-- Params:
-- @playerSource, number - The player's id
exports["bd-computer"]:FindGroupByMember(playerSource)
-- Example:
local groupId = exports["bd-computer"]:FindGroupByMember(1)
GetJobStatus
Returns the job status of the group
-- Params:
-- @groupId, number - The group's id
exports["bd-computer"]:GetJobStatus(groupId)
-- Example:
local status = exports["bd-computer"]: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-computer"]:SetJobStatus(groupId, status)
-- Example:
exports["bd-computer"]:SetJobStatus(1, "Ammunation Robbery")
GetGroupMembersCounts
Returns the amount of members in the group
-- Params:
-- @groupId, number - The group's id
exports["bd-computer"]:GetGroupMembersCount(groupId)
-- Example:
local membersAmount = exports["bd-computer"]: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-computer"]:CreateBlipForGroup(groupId, blipName, blipData)
-- Example:
exports["bd-computer"]: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-computer"]:RemoveBlipForGroup(groupId, blipName)
-- Example:
exports["bd-computer"]:RemoveBlipForGroup(1, "cocaine-supplies")
DestroyGroup
Destroys the given group.
-- Params:
-- @groupId, number - The group's id
exports["bd-computer"]:DestroyGroup(groupId)
-- Example:
exports["bd-computer"]: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-computer"]:NotifyGroup(groupId, message, timeout)
-- Example:
exports["bd-computer"]: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-computer"]:DoesGroupExist(groupId)
-- Example:
exports["bd-computer"]:DoesGroupExist(1)
FinishContract
Finishes the started contract for the group. It makes the contract expire and starts resetting.
-- Params:
-- @groupId, number - The group's id
exports["bd-computer"]:FinishContract(groupId)
-- Example:
exports["bd-computer"]:FinishContract(1)