Squirrel/Server/Functions/Pickups/InstantRespawn

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example 2. Setting)
 
Line 42: Line 42:
 
</code>
 
</code>
  
== Notes ==
+
=== Notes ===
  
 
The event [[Squirrel/Server/Events/Pickup/onPickupPickedUp|onPickupPickedUp]] was used in this example. More info about this in the corresponding page.
 
The event [[Squirrel/Server/Events/Pickup/onPickupPickedUp|onPickupPickedUp]] was used in this example. More info about this in the corresponding page.

Latest revision as of 17:55, 23 October 2010

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


This Pickup class member returns/sets whether the given pickup respawns when you hit it.

[edit] Syntax

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

  1. Bool pickup.InstantRespawn
  1. pickup.InstantRespawn = bool bRespawn

[edit] Arguments

  • bRespawn - A boolean representing whether the given pickup respawns when you hit it.

[edit] Example 1. Returning

This will tell the player the current InstantRespawn state of the collected pickup

  1.  
  2. function onPickupPickedUp( pPlayer, pPickup )
  3. {
  4. MessagePlayer( "Pickup Instant Respawn: " + pPickup.Instant Respawn, 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 collected pickup to Instant Respawn.

  1.  
  2. function onPickupPickedUp( pPlayer, pPickup )
  3. {
  4. pPickup.InstantRespawn = true;
  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