Squirrel/Client/Events/Player/onClientSpawn
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|onClientSpawn}} This event is called when the local player spawns. == Syntax == <code>function onClientSpawn( spawnclass )</code> === Arguments === * '''spaw…') |
(→Example) |
||
Line 16: | Line 16: | ||
== Example == | == Example == | ||
− | + | This will print the district the player spawned in. | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onClientSpawn( spawnclass ) | |
+ | { | ||
+ | Message("You spanwed 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:04, 11 November 2013
This event is called when the local player spawns.
[edit] Syntax
function onClientSpawn( spawnclass )
[edit] Arguments
- spawnclass - The pointer to the class the local player spawned as
[edit] Returns
This event does not handle return values.
[edit] Example
This will print the district the player spawned in.
function onClientSpawn( spawnclass ) { Message("You spanwed 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