Squirrel/Server/Functions/Pickups/RespawnTime

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
Line 31: Line 31:
 
== Example 2. Setting ==
 
== Example 2. Setting ==
  
Explanation of what this function does.
+
This will set the respawn time of the collected pickup to 10 seconds.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- Todo
+
function onPickupPickedUp( pPlayer, pPickup )
 +
{
 +
pPickup.RespawnTime = 10000;
 +
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
List of used functions and events including links to their corresponding pages.
+
The event [[Squirrel/Server/Events/Pickup/onPickupPickedUp|onPickupPickedUp]] was used in this example. More info about this in the corresponding page.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Pickups}}
 
{{Squirrel/Server/Functions/Pickups}}

Revision as of 18:39, 23 October 2010

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


This Pickup class member returns or sets the respawn time of the given pickup.

Syntax

You can either return or set a new value using this member:

  1. Integer pickup.RespawnTime
  1. pickup.RespawnTime = integer iRespawnTime

Arguments

  • iRespawnTime - This is the new respawn time for the pickup as a Integer in milliseconds.

Example 1. Returning

This will tell the player how long it will take the pickup to respawn in milliseconds.

  1.  
  2. function onPickupPickedUp( pPlayer, pPickup )
  3. {
  4. MessagePlayer( "Pickup Respawn time: " + pPickup.RespawnTime, pPlayer );
  5. return 1;
  6. }
  7.  

Notes

The function MessagePlayer and event onPickupPickedUp were used in this example. More info about them in the corresponding pages.

Example 2. Setting

This will set the respawn time of the collected pickup to 10 seconds.

  1.  
  2. function onPickupPickedUp( pPlayer, pPickup )
  3. {
  4. pPickup.RespawnTime = 10000;
  5. return 1;
  6. }
  7.  

Notes

The event onPickupPickedUp was used in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox