# Client Exports

Client Only

`GetFramework` - Returns the detected framework (qb, qbx, esx, or nil if none detected).

```lua
exports['sd_lib']:GetFramework()
-- Returns: string
```

`GetJobUpdateEvents` - Returns job update event names for current framework.

```lua
exports['sd_lib']:GetJobUpdateEvents()
-- Returns: table - Array of event names
-- QB/QBX: { 'QBCore:Client:OnJobUpdate' }
-- ESX: { 'esx:setJob' }
```

`GetPlayerLoadedEvents` - Returns player loaded event names for current framework.

```lua
exports['sd_lib']:GetPlayerLoadedEvents()
-- Returns: table - Array of event names
-- QB/QBX: { 'QBCore:Client:OnPlayerLoaded' }
-- ESX: { 'esx:playerLoaded' }
```

`GetPlayerData` - Gets current player data.

```lua
exports['sd_lib']:GetPlayerData()
-- Returns: table - Player data
```

`GetPlayerFullName` - Gets current player's full name.

```lua
exports['sd_lib']:GetPlayerFullName()
-- Returns: string - Player full name
```

`GetPlayerJobName` - Gets current player's job name.

```lua
exports['sd_lib']:GetPlayerJobName()
-- Returns: string - Job name
```

`GetFunds` - Gets current player's money.

```lua
exports['sd_lib']:GetFunds()
-- Returns: table
-- {
--     cash = number,  -- Cash amount
--     bank = number   -- Bank amount
-- }
```

`GetPlayerName` - Gets current player's name.

```lua
exports['sd_lib']:GetPlayerName()
-- Returns: string - Player name
```

`GetPlayerJobGrade` - Gets current player's job grade name.

```lua
exports['sd_lib']:GetPlayerJobGrade()
-- Returns: string - Grade name
```

`GetPlayerStats` - Gets current player's stats (hunger, thirst).

```lua
exports['sd_lib']:GetPlayerStats()
-- Returns: table
-- {
--     hunger = number,
--     thirst = number
-- }
```

`GetCharId` - Gets current player's character ID.

```lua
exports['sd_lib']:GetCharId()
-- Returns: number or nil - Character ID (citizenid for QB, identifier for ESX)
```

`GetPlayerJob` - Gets current player's full job data.

```lua
exports['sd_lib']:GetPlayerJob()
-- Returns: table or nil
-- {
--     name = string,        -- Job name
--     label = string,       -- Job label
--     grade = number,       -- Grade level
--     grade_name = string,  -- Grade name
--     isBoss = boolean      -- Whether player is boss
-- }
```

`SpawnVehicle` - Spawns a vehicle.

```lua
exports['sd_lib']:SpawnVehicle(model, cb, coords, isNetworked)
-- model: string or number - Vehicle model name or hash
-- cb: function - Callback function with vehicle entity
-- coords: vector4 - Spawn coordinates (x, y, z, heading)
-- isNetworked: boolean - Whether vehicle is networked (default true)
```

`SetVehicleProperties` - Sets vehicle properties.

```lua
exports['sd_lib']:SetVehicleProperties(vehicle, props)
-- vehicle: number - Vehicle entity handle
-- props: table - Vehicle properties
-- Returns: boolean - Success status
```

`GetVehicleProperties` - Gets vehicle properties.

```lua
exports['sd_lib']:GetVehicleProperties(vehicle)
-- vehicle: number - Vehicle entity handle
-- Returns: table - Vehicle properties
```

`ShowNotification` - Shows a notification.

```lua
exports['sd_lib']:ShowNotification(message, type, duration)
-- message: string - Notification message
-- type: string - Optional notification type (success, error, warning, info, primary)
-- duration: number - Optional duration in milliseconds
```

`ShowProgress` - Shows a progress bar.

```lua
exports['sd_lib']:ShowProgress(label, duration, callback)
-- label: string - Progress label
-- duration: number - Duration in milliseconds
-- callback: function - Callback function on completion
```

`ShowTextUI` - Shows text UI.

```lua
exports['sd_lib']:ShowTextUI(message, option, extra)
-- message: string - Text message
-- option: string - Optional UI option or position
-- extra: string - Optional extra parameter (position for ox_lib)
```

`HideTextUI` - Hides text UI.

```lua
exports['sd_lib']:HideTextUI()
```

`Skillcheck` - Starts a skill check minigame.

```lua
exports['sd_lib']:Skillcheck(difficulty, inputs, callback)
-- difficulty: string - Difficulty level ('easy', 'medium', 'hard')
-- inputs: table - Number of skill checks or inputs array
-- callback: function - Callback function with success boolean
```

`CreatePolyZone` - Creates a polygon zone.

```lua
exports['sd_lib']:CreatePolyZone(data)
-- data: table
-- {
--     points = table,        -- Array of vector3 points
--     thickness = number,    -- Optional zone thickness (default 2.0)
--     debug = boolean,       -- Optional debug mode
--     minZ = number,         -- Optional minimum Z height
--     maxZ = number,         -- Optional maximum Z height
--     name = string,         -- Optional zone name (PolyZone)
--     onEnter = function,    -- Optional callback on enter
--     onExit = function,     -- Optional callback on exit
--     inside = function      -- Optional callback while inside
-- }
-- Returns: zone object
```

`CreateBoxZone` - Creates a box zone.

```lua
exports['sd_lib']:CreateBoxZone(data)
-- data: table
-- {
--     coords = vector3,      -- Center coordinates
--     size = vector3,        -- Box size (x, y, z)
--     rotation = number,     -- Optional rotation
--     debug = boolean,       -- Optional debug mode
--     minZ = number,         -- Optional minimum Z height
--     maxZ = number,         -- Optional maximum Z height
--     name = string,         -- Optional zone name (PolyZone)
--     onEnter = function,    -- Optional callback on enter
--     onExit = function,     -- Optional callback on exit
--     inside = function      -- Optional callback while inside
-- }
-- Returns: zone object
```

`CreateSphereZone` - Creates a sphere zone.

```lua
exports['sd_lib']:CreateSphereZone(data)
-- data: table
-- {
--     coords = vector3,      -- Center coordinates
--     radius = number,       -- Sphere radius
--     debug = boolean,       -- Optional debug mode
--     name = string,         -- Optional zone name (PolyZone)
--     onEnter = function,    -- Optional callback on enter
--     onExit = function,     -- Optional callback on exit
--     inside = function      -- Optional callback while inside
-- }
-- Returns: zone object
```

`DeleteZone` - Deletes a zone.

```lua
exports['sd_lib']:DeleteZone(zone)
-- zone: object - Zone object to delete
```

`CreateInteractionPoint` - Creates an interaction point.

```lua
exports['sd_lib']:CreateInteractionPoint(coords, options)
-- coords: vector3 - Position coordinates
-- options: table
-- {
--     distance = number,     -- Interaction distance (default from config)
--     size = vector3,        -- Optional box size for ox_target/qb-target
--     rotation = number,     -- Optional rotation for ox_target/qb-target
--     name = string,         -- Optional zone name for qb-target
--     debug = boolean,       -- Optional debug mode for qb-target
--     onEnter = function,    -- Optional callback on enter (textui)
--     onExit = function,     -- Optional callback on exit (textui)
--     options = {           -- Available options
--         {
--             label = string,       -- Option label
--             icon = string,        -- Optional icon
--             action = function,    -- Action callback (receives entity)
--             onSelect = function, -- Alternative callback (receives entity)
--             canInteract = function -- Optional interaction check
--         }
--     }
-- }
-- Returns: string - Interaction point ID
```

`CreateVehicleInteraction` - Creates vehicle interaction.

```lua
exports['sd_lib']:CreateVehicleInteraction(options)
-- options: table
-- {
--     distance = number,     -- Interaction distance (default from config)
--     onEnter = function,    -- Optional callback on enter (textui)
--     onExit = function,     -- Optional callback on exit (textui)
--     options = {           -- Available options
--         {
--             label = string,       -- Option label
--             icon = string,        -- Optional icon
--             action = function,    -- Action callback (receives vehicle)
--             onSelect = function, -- Alternative callback (receives vehicle)
--             canInteract = function -- Optional interaction check
--         }
--     }
-- }
-- Returns: string - Vehicle interaction ID
```

`CreateModelInteraction` - Creates model interaction.

```lua
exports['sd_lib']:CreateModelInteraction(models, options)
-- models: table - Array of model names or hashes
-- options: table
-- {
--     distance = number,     -- Interaction distance (default from config)
--     onEnter = function,    -- Optional callback on enter (textui)
--     onExit = function,     -- Optional callback on exit (textui)
--     options = {           -- Available options
--         {
--             label = string,       -- Option label
--             icon = string,        -- Optional icon
--             name = string,       -- Optional name for ox_target/qb-target
--             action = function,    -- Action callback (receives entity)
--             onSelect = function, -- Alternative callback (receives entity)
--             canInteract = function -- Optional interaction check
--         }
--     }
-- }
-- Returns: string - Model interaction ID
```

`CreateEntityInteraction` - Creates entity interaction.

```lua
exports['sd_lib']:CreateEntityInteraction(entity, options)
-- entity: number - Entity handle
-- options: table
-- {
--     distance = number,     -- Interaction distance (default from config)
--     onEnter = function,    -- Optional callback on enter (textui)
--     onExit = function,     -- Optional callback on exit (textui)
--     options = {           -- Available options
--         {
--             label = string,       -- Option label
--             icon = string,        -- Optional icon
--             action = function,    -- Action callback (receives entity)
--             onSelect = function, -- Alternative callback (receives entity)
--             canInteract = function -- Optional interaction check
--         }
--     }
-- }
-- Returns: string - Entity interaction ID
```

`RemoveInteractionPoint` - Removes an interaction point.

```lua
exports['sd_lib']:RemoveInteractionPoint(pointId)
-- pointId: string - Interaction point ID
```

`RemoveVehicleInteraction` - Removes vehicle interaction.

```lua
exports['sd_lib']:RemoveVehicleInteraction(vehicleId)
-- vehicleId: string - Vehicle interaction ID
```

`RemoveModelInteraction` - Removes model interaction.

```lua
exports['sd_lib']:RemoveModelInteraction(modelId)
-- modelId: string - Model interaction ID
```

`RemoveEntityInteraction` - Removes entity interaction.

```lua
exports['sd_lib']:RemoveEntityInteraction(entityId)
-- entityId: string - Entity interaction ID
```

`HandleDrawText` - Handles draw text interaction (manual 3D text).

```lua
exports['sd_lib']:HandleDrawText(pos, radius, options, entity)
-- pos: vector3 - Position
-- radius: number - Detection radius
-- options: table - Interaction options array
-- entity: number - Optional entity handle
```

`GetRadioChannel` - Gets current radio channel.

```lua
exports['sd_lib']:GetRadioChannel()
-- Returns: number - Radio channel (0 if not in radio)
```

`IsUsingRadio` - Checks if player is using radio.

```lua
exports['sd_lib']:IsUsingRadio()
-- Returns: boolean - Radio usage status
```

`Dispatch` - Sends dispatch alert.

```lua
exports['sd_lib']:Dispatch(coords, code, priority, content, jobs, title, info)
-- coords: vector3 - Alert coordinates
-- code: string - Optional dispatch code (default '10-00')
-- priority: string - Optional priority ('low', 'medium', 'high')
-- content: string - Alert description
-- jobs: table - Array of job names to notify (e.g., {'police', 'ambulance'})
-- title: string - Optional alert title
-- info: table - Optional additional info for sd_dispatch
```

`ShowDialog` - Shows input dialog.

```lua
exports['sd_lib']:ShowDialog(header, inputs, callback)
-- header: string - Dialog header
-- inputs: table - Input rows
-- {
--     {
--         type = string,     -- Input type ('input', 'number', 'password', etc.)
--         label = string,    -- Input label
--         default = string,  -- Optional default value
--         required = boolean -- Optional required field
--     }
-- }
-- callback: function - Callback function with results table
```

`CloseDialog` - Closes current dialog.

```lua
exports['sd_lib']:CloseDialog()
```

`GetInventoryImagePath` - Gets inventory item image path.

```lua
exports['sd_lib']:GetInventoryImagePath()
-- Returns: string - Image path for current inventory system
```

`GetItemCount` - Gets item count in player inventory.

```lua
exports['sd_lib']:GetItemCount(item)
-- item: string - Item name
-- Returns: number - Item count (only works with ox_inventory or ps-inventory)
```

`TriggerCallback` - Triggers a server callback.

```lua
exports['sd_lib']:TriggerCallback(name, cb, ...)
-- name: string - Callback name
-- cb: function - Callback function with result
-- ... - Additional parameters to pass to server
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spark-developments.gitbook.io/dev/library/sd_lib/client-exports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
