Squirrel/Client/Events/Player/onClientRequestClass

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|onClientRequestClass}} This event is called when the local player requests another spawn class. == Syntax == <code>function onClientRequestClass( spawnclass )<…')
 
(Example)
 
Line 16: Line 16:
 
== Example ==
 
== Example ==
  
Some explanation here
+
This will message the player in which district they will spawn, should they choose the selected skin.
{{Squirrel/NeedsExample}}
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onClientRequestClass( spawnclass )
 +
{
 +
Message("You will spawn in the " + GetDistrictName( spawnclass.Pos ) + " district.");
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- List of used functions and other notes here.
+
The functions [[Squirrel/Client/Functions/Messages/Message|Message]] and [[Squirrel/Client/Functions/Misc/GetDistrictName|GetDistrictName]] were used in in this example. More info about them in corresponding pages.
  
 
== Related Events ==
 
== Related Events ==
  
 
{{Squirrel/Client/Events/Player}}
 
{{Squirrel/Client/Events/Player}}

Latest revision as of 21:02, 11 November 2013

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This event is called when the local player requests another spawn class.

[edit] Syntax

  1. function onClientRequestClass( spawnclass )

[edit] Arguments

  • spawnclass - The pointer to the class the local player requested

[edit] Returns

This event does not handle return values.

[edit] Example

This will message the player in which district they will spawn, should they choose the selected skin.

  1.  
  2. function onClientRequestClass( spawnclass )
  3. {
  4. Message("You will spawn in the " + GetDistrictName( spawnclass.Pos ) + " district.");
  5. }
  6.  

[edit] Notes

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

[edit] Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox