gfxr-spawnselector-redm
Spawn point selection UI for RedM. Allows players to choose their spawn location from predefined map locations or return to their last known position.
Features
- Visual spawn location selector with background images
- "Last Location" option to spawn where you left off
- Western-themed UI with Vue.js frontend
- Configurable spawn locations with custom coordinates
Dependencies
| Dependency | Description |
|---|---|
| VORP Framework | Required (triggers vorp:initCharacter event) |
Installation
Add to server.cfg:
ensure gfxr-spawnselector-redmConfigure spawn locations:
- Edit
config.luawith your desired coordinates
- Edit
Configuration
config.lua
Config = {}
Config.Locations = {
{
image = "image-ambarino.png",
name = "Ambarino",
coords = vector3(-552.0, 632.0, 127.0)
},
{
image = "image-hannover.png",
name = "Hannover",
coords = vector3(0, 0, 0)
},
{
image = "image-elizabeth.png",
name = "Elizabeth",
coords = vector3(-552.0, 632.0, 127.0)
},
{
image = "image-austin.png",
name = "Austin",
coords = vector3(-552.0, 632.0, 127.0)
}
}
Each location requires:
| Field | Type | Description |
|---|---|---|
| image | string | Background image filename (placed in ui/assets/) |
| name | string | Display name shown in the UI |
| coords | vector3 | Spawn coordinates (x, y, z) |
Events
Triggering the Spawn Selector
The spawn selector is opened via a client event:
TriggerClientEvent('gfxr-spawnselector:Init:Vorp', source, playerCoords, heading, isDead)
| Parameter | Type | Description |
|---|---|---|
| playerCoords | vector3 | Player's last known coordinates |
| heading | number | Player's last heading/direction |
| isDead | boolean | Whether the player was dead |
NUI Callbacks
| Callback | Description |
|---|---|
SpawnLastLocation |
Player chose to spawn at their last location |
SpawnLocation |
Player selected a specific spawn point |
Both callbacks trigger vorp:initCharacter with the appropriate coordinates and heading.
Adding New Locations
- Add your location image to the
ui/assets/folder - Add a new entry to
Config.Locationsinconfig.lua:{ image = "your-image.png", name = "Location Name", coords = vector3(x, y, z) } - Restart the resource