Skip to Content

Shared Exports

Shared exports are available on both the client and server.

AddCheck

Registers a check that can allow or prevent an LB Racing action. Return false to prevent the action. The export returns an ID that can be passed to RemoveCheck.

CheckSideHandler parameters
openTabletClientNone
enableFreecamClientNone
readyUpRaceClientraceId
readyUpRaceServersource, raceId
---@alias RacingCheckEvent "openTablet" | "enableFreecam" | "readyUpRace" ---@param event RacingCheckEvent ---@param handler fun(...: any): boolean ---@return number checkId local checkId = exports["lb-racing"]:AddCheck(event, handler)

For example, prevent the standalone tablet from opening while the player is dead:

local checkId = exports["lb-racing"]:AddCheck("openTablet", function() return not IsEntityDead(PlayerPedId()) end)

Checks are automatically removed when the resource that registered them stops.

RemoveCheck

---@param checkId number ---@return boolean success local success = exports["lb-racing"]:RemoveCheck(checkId)