Squirrel/Server/Functions/Pickups/RespawnTime

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Some tit said the time was in milliseconds, its in seconds >:()
 
Line 10: Line 10:
 
== Arguments ==
 
== Arguments ==
  
* '''iRespawnTime''' - This is the new respawn time for the pickup as a Integer in '''milliseconds'''.
+
* '''iRespawnTime''' - This is the new respawn time for the pickup as a Integer in '''seconds'''.
  
 
== Example 1. Returning ==
 
== Example 1. Returning ==
  
This will tell the player how long it will take the pickup to respawn in milliseconds.
+
This will tell the player how long it will take the pickup to respawn in seconds.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
Line 36: Line 36:
 
function onPickupPickedUp( pPlayer, pPickup )
 
function onPickupPickedUp( pPlayer, pPickup )
 
{
 
{
pPickup.RespawnTime = 10000;
+
pPickup.RespawnTime = 10;
 
 
 
return 1;
 
return 1;

Latest revision as of 18:29, 16 March 2011

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.

[edit] Syntax

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

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

[edit] Arguments

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

[edit] Example 1. Returning

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

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

[edit] Notes

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

[edit] 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 = 10;
  5. return 1;
  6. }
  7.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox