Squirrel/Client/Events/Pickup/onPickupRespawn

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Added example)
m (Modified example)
 
Line 16: Line 16:
 
== Example ==
 
== Example ==
  
This function teleports a player near a pickup after it respawns.
+
This function tells a player a pickup has respawned.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 
function onPickupRespawn( pickup )
 
function onPickupRespawn( pickup )
 
{
 
{
     local player = FindLocalPlayer();
+
     Message( pickup.ID + " has just respawned at " + pickup.Pos.x + ", " + pickup.Pos.y + "." );
    player.Pos = Vector( (pickup.Pos.x - 3), (pickup.Pos.y - 3), pickup.Pos.z );
+
 
}
 
}
 
</code>
 
</code>
Line 28: Line 27:
 
=== Notes ===
 
=== Notes ===
  
The client functions [[Squirrel/Client/Functions/Pickups/Pos|Pickup.Pos]], [[Squirrel/Client/Functions/Players/Pos|Player.Pos]] and [[Squirrel/Client/Functions/Players/FindLocalPlayer|FindLocalPlayer]] were used in this example. More information can be found on their corresponding pages.
+
The client functions [[Squirrel/Client/Functions/Pickups/Pos|Pickup.Pos]] and [[Squirrel/Client/Functions/Messages/Message|Message]] were used in this example. More information can be found on their corresponding pages.
  
 
== Related Events ==
 
== Related Events ==
  
 
{{Squirrel/Client/Events/Pickups}}
 
{{Squirrel/Client/Events/Pickups}}

Latest revision as of 12:46, 2 August 2011

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

This event is called a pickup has been respawned.

[edit] Syntax

  1. function onPickupRespawn( pickup )

[edit] Arguments

  • pickup - The pointer of the pickup thats been respawned

[edit] Returns

This event does not handle return values.

[edit] Example

This function tells a player a pickup has respawned.

  1.  
  2. function onPickupRespawn( pickup )
  3. {
  4. Message( pickup.ID + " has just respawned at " + pickup.Pos.x + ", " + pickup.Pos.y + "." );
  5. }
  6.  

[edit] Notes

The client functions Pickup.Pos and Message were used in this example. More information can be found on their corresponding pages.

[edit] Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox