Summary
Hooks
cwSpawnPointESP convar is on.info_player_start entities added, for the admin ESP.cwSpawnPointESP convar and its admin ESP setting.cwSpawnPoints.spawnPoints.cwSpawnPoints.spawnPoints to the schema data and sends the updated ESP data to every admin.Hooks
cwSpawnPoints:ClockworkInitPostEntity()
server gamemodes/catwork/plugins/spawnpoints/plugin/sv_hooks.lua:7Implements hook ClockworkInitPostEntity
Called after Catwork has loaded all of its entities; loads the saved spawn points.
cwSpawnPoints:GetAdminESPInfo(info)
client gamemodes/catwork/plugins/spawnpoints/plugin/cl_hooks.lua:28Called to collect admin ESP entries; adds every spawn point when the cwSpawnPointESP convar is on.
Each entry is labelled with its faction, class or default name, colored after the matching class.
Parameters
- info List<Map> ESP entries to add to, each with
positionand atextlist
Returns a copy of the spawn points with the map's info_player_start entities added, for the admin ESP.
Returns
- Map Lists of
{ position, rotate }points keyed by faction or class name,defaultorSource Spawnpoint
Called when the plugin is initialized; creates the cwSpawnPointESP convar and its admin ESP setting.
cwSpawnPoints:LoadSpawnPoints()
server gamemodes/catwork/plugins/spawnpoints/plugin/sv_plugin.lua:10Loads the current map's spawn points from the schema data into cwSpawnPoints.spawnPoints.
Points are grouped by faction or class name, or under default; groups for factions and classes that
no longer exist are dropped. Positions saved as 'x, y, z' strings are converted to vectors.
cwSpawnPoints:OnPlayerUserGroupSet(player, usergroup)
server gamemodes/catwork/plugins/spawnpoints/plugin/sv_hooks.lua:65Implements hook OnPlayerUserGroupSet
Called when a player's user group is set; sends the spawn point ESP data to operators and above.
Parameters
- player Player The player whose group was set
- usergroup String The new user group
cwSpawnPoints:PlayerSpawn(player)
server gamemodes/catwork/plugins/spawnpoints/plugin/sv_hooks.lua:35Called when a player spawns; moves them to a random spawn point for their class, faction or the default.
Class spawn points take priority over faction ones; the default set is used only when the faction has
none. The player is placed 8 units above the point and turned to its rotate yaw. Admins also receive
the spawn point ESP data.
Parameters
- player Player The player who spawned
cwSpawnPoints:SaveSpawnPoints()
server gamemodes/catwork/plugins/spawnpoints/plugin/sv_plugin.lua:54Saves cwSpawnPoints.spawnPoints to the schema data and sends the updated ESP data to every admin.
Positions are stored as 'x, y, z' strings.