Squirrel/Client/Events/Player/onClientRequestSpawn

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ 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 == <code>int onClientReque...)
 
m (silly me)
 
Line 29: Line 29:
 
=== Notes ===
 
=== Notes ===
  
The function [[Squirrel/Client/Functions/Messages/Message|Message]] was used in in this example. More info about it in the corresponding page.
+
The functions [[Squirrel/Client/Functions/Messages/Message|Message]] and [[Squirrel/Client/Functions/SpawnClass/Skin|SpawnClass.Skin]] were used in in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Client/Events/Player}}
 
{{Squirrel/Client/Events/Player}}

Latest revision as of 13:08, 30 March 2010

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.

[edit] Syntax

  1. int onClientRequestSpawn( SpawnClass pClass )

[edit] Parameters

  • pClass - The pointer of the class player has selected

[edit] 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.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox