Skip to Content
ResourcesSpawnmanagerspawnmanager

About

The spawnmanager is a base resource that handles the spawning of the player. It allows you to choose when and where to spawn the player and also control how they respawn.

Spawnmanager is included and maintained at the cfx-server-data  repository.

Map resources for mapmanager will have their spawnpoints loaded and usable in spawnmanager, as long as they are started after spawnmanager.

Exports

Client

  • spawnPlayer - Spawns the player using configured spawn points
  • addSpawnPoint - Adds a custom spawn point
  • removeSpawnPoint - Removes a spawn point
  • loadSpawns - Loads spawn points from map resources
  • setAutoSpawn - Enables or disables automatic spawning
  • setAutoSpawnCallback - Sets callback for auto spawn
  • forceRespawn - Forces the player to respawn

Events

Client

  • playerSpawned - Fires when the player has spawned