> For the complete documentation index, see [llms.txt](https://wiki.qfdevelopers.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.qfdevelopers.com/scripts/editor-2/additional-informations.md).

# Additional Informations

#### Core Features

* **Cinematic Engine:** Utilizes native GTA V sky-cam transitions (`SwitchOutPlayer`, `SwitchInPlayer`) for a premium feel.
* **Economic Integration:** Charge players money to spawn in premium or strategic locations.
* **Job Restriction:** Keep faction-specific spawns (like PDs, Hospitals, Gang HQs) hidden from the general public.
* **Audio Ambience:** Built-in music player to maintain atmosphere during the selection phase.

#### Developer API (Events & Hooks)

The Spawn Selector exposes specific events allowing developers to manually trigger the UI, or execute logic the exact moment a player finalizes their spawn choice.

{% tabs %}
{% tab title="Client-Side Trigger" %}
If you have a custom script (such as a tutorial sequence, unique login system, or custom character selection) and want to manually open the spawn selector UI, trigger this client-side event:

```lua
-- CLIENT-SIDE
-- Opens the spawn selector UI
-- @param isNew boolean - Indicates if the player is a brand new character.
-- (Set to true to filter out features like 'last location' and paid spawns for new characters)

local isNewCharacter = false
TriggerEvent('qf_spawnselector_v2:open', isNewCharacter)
```

{% endtab %}

{% tab title="Server-Side Hook" %}
Once the player selects a location and the cinematic sequence concludes, the script registers and handles the spawn completion. If you want other server-side resources to listen to this event, hook into this Net Event:

```lua
-- SERVER-SIDE
-- Listen for player spawn selection completion
RegisterNetEvent('qf_spawnselector_v2:playerSpawned', function(spawnId)
    local src = source -- Server ID of the player who spawned
    
    -- 'spawnId' matches the 'id' field of the selected location in Config.Spawns (or "last-location")
    if spawnId == "last-location" then
        print(("Player %s resumed from their last known coordinates."):format(src))
    else
        print(("Player %s chose to spawn at: %s"):format(src, spawnId))
    end
    
    -- Example: Set custom routing bucket or give clothing items based on spawn choice
    SetPlayerRoutingBucket(src, 0)
    
    if spawnId == "lspd_hq" then
        -- Trigger job-uniform equip logic
    end
end)
```

{% endtab %}
{% endtabs %}

***

#### Frequently Asked Questions (Q\&A)

**Q: The camera gets stuck in the sky and never drops down. What is wrong?**\
A: This happens when the framework (ESX/QBCore) fails to load the player's data in time, or another script is freezing the player entity. Press F8 to check for client-side errors. Ensure your framework is fully initialized before triggering the spawn sequence.

**Q: How do I remove the cinematic sky-drop effect?**\
A: Open `config.lua` and set `Config.UseGTASwitch = false`. The UI will simply fade out, and the player will instantly teleport to their selected coordinates.

**Q: How do I restrict specific spawn points to factions or jobs?**\
A: You can configure the jobs filter inside `config/default_data.lua` by specifying the required job names and minimum grades. Unallowed players will not see those spawn points in the UI.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://wiki.qfdevelopers.com/scripts/editor-2/additional-informations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
