Squirrel/Client/Events/Player/onClientRequestClass
From Liberty Unleashed Wiki
(Difference between revisions)
(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 == | ||
− | + | This will message the player in which district they will spawn, should they choose the selected skin. | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onClientRequestClass( spawnclass ) | |
+ | { | ||
+ | Message("You will spawn in the " + GetDistrictName( spawnclass.Pos ) + " district."); | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | 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
This event is called when the local player requests another spawn class.
[edit] Syntax
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.
function onClientRequestClass( spawnclass ) { Message("You will spawn in the " + GetDistrictName( spawnclass.Pos ) + " district."); }
[edit] Notes
The functions Message and GetDistrictName were used in in this example. More info about them in corresponding pages.
[edit] Related Events
- onClientArmourChange
- onClientCashChange
- onClientCollideWithPlayer
- onClientCommand
- onClientDeath
- onClientFall
- onClientHealthChange
- onClientHurt
- onClientKill
- onClientKeyStateChange
- onClientRequestClass
- onClientRequestSpawn
- onClientShot
- onClientSpawn
- onClientUseDetonator
- onClientWeaponChange
- onPlayerDeath
- onPlayerJoin
- onPlayerKill
- onPlayerPart
- onPlayerSpawn