Buckets

SERVER SIDE ONLY

Small set of functions dedicated to fivem routing buckets.

Functions

set_player_bucket

Use the following to set a player into a routing bucket with specified settings.

--- Specify bucket params
local params = {
    bucket_id = 1,
    enable_population = true,
    lockdown_mode = 'relaxed',
    max_players = 64,
    spawn_coords = { x = 0.0, y = 0.0, z = 0.0 }
}

--- Utils object
utils.buckets.set_player_bucket(source, params)

--- Direct export
exports.boii_utils:set_player_bucket(source, params)

get_bucket_settings

Use the following to retrieve settings for a saved bucket.

--- Specify bucket id
local bucket_id = 1

--- Utils object
local settings = utils.buckets.get_bucket_settings(bucket_id)

if settings then print('Settings:', json.encode(settings)) end

--- Direct export
local settings = exports.boii_utils:get_bucket_settings(bucket_id)

get_players_in_buckets

Use the following to retrieve all players within a bucket.

--- Specify bucket id
local bucket_id = 1

--- Utils object
local players = utils.buckets.get_players_in_bucket(bucket_id)

if players then print('Players in bucket:', json.encode(players)) end

--- Direct export
local settings = exports.boii_utils:get_players_in_bucket(bucket_id)

temp_bucket

Use the following to add a player into a temporary bucket for a defined duration.

---- Specify bucket id
local bucket_id = 1
--- Specify duration in seconds (s)
local duration = 60

--- Utils object
utils.buckets.temp_bucket(source, bucket_id, duration)

--- Direct export
exports.boii_utils:temp_bucket(source, bucket_id, duration)

Last updated