This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Bz eGetPlayerSpawnPosEvent"

From BZFlagWiki
Jump to: navigation, search
Line 3: Line 3:
  
 
==Overview==
 
==Overview==
The '''bz_eGetPlayerSpawnPosEvent''' is an API event that you can use to get and modify a spawn location and is sent just before spawning a player.
+
The '''bz_eGetPlayerSpawnPosEvent''' is an API event that is called each time the server needs a new spawn postion.
  
 
==Data==
 
==Data==
'''bz_eGetPlayerSpawnPosEvent''' returns the '''bz_GetPlayerSpawnPosEventData''' data class.
+
'''bz_eGetPlayerSpawnPosEvent''' returns the '''bz_GetPlayerSpawnPosEventData_V1''' data class.
  
 
   {| border="1" cellpadding="20" cellspacing="0"
 
   {| border="1" cellpadding="20" cellspacing="0"
Line 19: Line 19:
 
   |playerID
 
   |playerID
 
   |int
 
   |int
   |ID of the player
+
   |ID of the player that is requesting the spawn position.
 
   |-
 
   |-
 
   |team
 
   |team
 
   |bz_eTeamType
 
   |bz_eTeamType
   |The team the player belongs to
+
   |The team the player is currently in.
 
   |-
 
   |-
 
   |handled
 
   |handled
 
   |bool
 
   |bool
   |Set this flag to true once you're done modifying the spawn position, so that other plugins will know whether they can edit the spawn position again
+
   |The current state representing if other plug-ins have modified the spawn position. Plug-ins that modify the spawn position should set this value to true to inform other plug-ins that have not processed yet.
 
   |-
 
   |-
 
   |pos
 
   |pos
 
   |float[3]
 
   |float[3]
   |Position where the player will be spawned
+
   |Position where the player will be spawned. This value is initialized to the server computed spawn position using the current spawn rules.
 
   |-
 
   |-
 
   |rot
 
   |rot
 
   |float
 
   |float
   |Rotation with which the player will be spawned
+
   |The rotational direction that the player will be spawned at. This value is initialized to the server computed spawn rotation using the current spawn rules.
 
   |-
 
   |-
 
   |time
 
   |time
 
   |double
 
   |double
   |Time at which this event was sent
+
   |The local server time of the event.
 
   |}
 
   |}
  
 
==Uses==
 
==Uses==
You can use this event to modify a player's spawn location
+
This is a modification event, plug-ins may change the pos and rot fields to effect changes in the spawn position that is used for the player.
 
+
[[Category:BZFS_API_Docs]]
+
[[Category:BZFS_API_Events]]
+

Revision as of 17:59, 28 November 2007

BZFS API Documentation This page contains part of the BZFS API documentation for use by Plug-ins on the BZFS server.

BZFS Event. This page documents a BZFS event that is called by the game server to notify plug-ins of various actions and state changes in the game world.


Overview

The bz_eGetPlayerSpawnPosEvent is an API event that is called each time the server needs a new spawn postion.

Data

bz_eGetPlayerSpawnPosEvent returns the bz_GetPlayerSpawnPosEventData_V1 data class.

name type value description
eventType bz_eEventType bz_eGetPlayerSpawnPosEventData
playerID int ID of the player that is requesting the spawn position.
team bz_eTeamType The team the player is currently in.
handled bool The current state representing if other plug-ins have modified the spawn position. Plug-ins that modify the spawn position should set this value to true to inform other plug-ins that have not processed yet.
pos float[3] Position where the player will be spawned. This value is initialized to the server computed spawn position using the current spawn rules.
rot float The rotational direction that the player will be spawned at. This value is initialized to the server computed spawn rotation using the current spawn rules.
time double The local server time of the event.

Uses

This is a modification event, plug-ins may change the pos and rot fields to effect changes in the spawn position that is used for the player.