Squirrel/Server/Events/Pickup/onPickupPickedUp

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|oonPickupPickedUp}}
This is called when a player comes into contact with a pick-up.
+
This is called when a player picks up a pick-up.
  
 
== Syntax ==
 
== Syntax ==
  
<code>function onPickupPickedUp( player, pickup )</code>
+
<code>function onPickupPickedUp( Player player, Pickup pickup )</code>
  
== Parameters ==
+
=== Arguments ===
  
* '''player''' - The player that collected the pick-up.
+
* '''player''' - The player that collected the pick-up
* '''pickup''' - The pickup which was collected.
+
* '''pickup''' - The pickup which was collected
  
 +
=== Returns ===
 +
 +
This event does not handle return values.
  
 
== Example ==
 
== Example ==
Line 20: Line 23:
 
{
 
{
 
     MessagePlayer( "You picked up pickup id " + pickup.ID + ", Model: " + pickup.Model, player );
 
     MessagePlayer( "You picked up pickup id " + pickup.ID + ", Model: " + pickup.Model, player );
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>
Line 25: Line 30:
 
=== Notes ===
 
=== Notes ===
  
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] was used in in this example. More info about this can be found in the corresponding page.
+
The functions [[Squirrel/Server/Functions/Pickups/ID|Pickup.ID]], [[Squirrel/Server/Functions/Pickups/Model|Pickup.Model]] and [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] were used in in this example. More info about them can be found in the corresponding pages.
  
 
== Related Events ==
 
== Related Events ==
  
 
{{Squirrel/Server/Events/Pickup}}
 
{{Squirrel/Server/Events/Pickup}}

Revision as of 16:33, 4 November 2010

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

This is called when a player picks up a pick-up.

Syntax

  1. function onPickupPickedUp( Player player, Pickup pickup )

Arguments

  • player - The player that collected the pick-up
  • pickup - The pickup which was collected

Returns

This event does not handle return values.

Example

This example will tell the player which pickup they have just hit.

  1.  
  2. function onPickupPickedUp( player, pickup )
  3. {
  4. MessagePlayer( "You picked up pickup id " + pickup.ID + ", Model: " + pickup.Model, player );
  5. return 1;
  6. }
  7.  

Notes

The functions Pickup.ID, Pickup.Model and MessagePlayer were used in in this example. More info about them can be found in the corresponding pages.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox