Squirrel/Client/Events/Player/onClientRequestSpawn

From Liberty Unleashed Wiki
Jump to: navigation, search

This event is called when a player requests spawn by pressing the spawn key. You can cancel this event and prevent spawning by returning 0.

Syntax

  1. int onClientRequestSpawn( SpawnClass pClass )

Parameters

  • pClass - The pointer of the class player has selected

Example

This example will not allow spawning as skin ID 15

  1.  
  2. function onClientRequestSpawn( pClass )
  3. {
  4. if ( pClass.Skin == 15 )
  5. {
  6. Message( "You are not allowed to use this skin!" );
  7. return 0;
  8. }
  9. return 1;
  10. }
  11.  

Notes

The functions Message and SpawnClass.Skin were used in in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox