Squirrel/Client/Events/Player/onPlayerSpawn
From Liberty Unleashed Wiki
(Difference between revisions)
(Added an example.) |
(Fixed a broken example) |
||
Line 4: | Line 4: | ||
== Syntax == | == Syntax == | ||
− | <code>function onPlayerSpawn( player, | + | <code>function onPlayerSpawn( player, spawn )</code> |
=== Arguments === | === Arguments === | ||
* '''player''' - The pointer to the player that left | * '''player''' - The pointer to the player that left | ||
− | * ''' | + | * '''spawn''' - The pointer to the class they spawned as |
=== Returns === | === Returns === | ||
Line 19: | Line 19: | ||
This example outputs your skin ID when you spawn. | This example outputs your skin ID when you spawn. | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function onPlayerSpawn( player, | + | function onPlayerSpawn( player, spawn ) |
{ | { | ||
// Get the classes skin ID and save it as 'skin' | // Get the classes skin ID and save it as 'skin' | ||
− | local skin = | + | local skin = spawn.Skin; |
// Output their new skin | // Output their new skin |
Latest revision as of 20:06, 14 October 2012
This event is called when a remote player spawns
[edit] Syntax
function onPlayerSpawn( player, spawn )
[edit] Arguments
- player - The pointer to the player that left
- spawn - The pointer to the class they spawned as
[edit] Returns
This event does not handle return values.
[edit] Example
This example outputs your skin ID when you spawn.
function onPlayerSpawn( player, spawn ) { // Get the classes skin ID and save it as 'skin' local skin = spawn.Skin; // Output their new skin Message( "* You have just spawned as skin " + skin + ".", 0, 255, 0 ); return 1; }
[edit] Notes
-- List of used functions and other notes here.
[edit] Related Events
- onClientArmourChange
- onClientCashChange
- onClientCollideWithPlayer
- onClientCommand
- onClientDeath
- onClientFall
- onClientHealthChange
- onClientHurt
- onClientKill
- onClientKeyStateChange
- onClientRequestClass
- onClientRequestSpawn
- onClientShot
- onClientSpawn
- onClientUseDetonator
- onClientWeaponChange
- onPlayerDeath
- onPlayerJoin
- onPlayerKill
- onPlayerPart
- onPlayerSpawn