PlayerSpawnedWithPawn

From The KillerJim Mod Wiki

PlayerProxy::PlayerSpawnedWithPawn

PlayerSpawnedWithPawn.png

Client/Server Event - This is an event fires on both clients and servers

Description

This is probably one of the most important events for dealing with players spawning in your game-modes.

This event is triggered on both clients and server when a player's pawn is spawned (on the first spawn and on respawn) and available to the client. This means that both server and clients can perform operation that require access to the pawn.

Common server activities include:

  Attaching the player proxy to the actual pawn, so it moves with it in 3D space
  Changing character models to the correct game-mode items
  Registering tools and gun's that the pawn can be given 
  Setting initial tools or guns the player will have

Common client activities include:

  Detecting local proxy spawning
  Resetting any visual aspects of the player proxy
Arguments

None

Example

This small section of the TTT game-mode shows the event being branched into the server (Authority) and client (Remote) paths. The server path effectively attaches this player proxy to the pawn, meaning when the pawn moves the player proxy will also mode. In the case of TTT the player proxy has a 3D plane that indicates the position of terrorist players (to other terrorist players), and therefore the who need to be attached to each other.

PlayerSpawnedWithPawnExample.png

Playing

Developers

Developer Reference