Squirrel/Server/Functions/Pickups/InstantRespawn
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|Pickup.InstantRespawn}} __NOTOC__ This ''Pickup'' class member returns/sets whether the given pickup respawns when you hit it. == Syntax == You can either retur…') |
|||
(2 intermediate revisions by one user not shown) | |||
Line 12: | Line 12: | ||
* '''bRespawn''' - A boolean representing whether the given pickup respawns when you hit it. | * '''bRespawn''' - A boolean representing whether the given pickup respawns when you hit it. | ||
− | == Example == | + | == Example 1. Returning == |
− | + | This will tell the player the current InstantRespawn state of the collected pickup | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPickupPickedUp( pPlayer, pPickup ) | |
+ | { | ||
+ | MessagePlayer( "Pickup Instant Respawn: " + pPickup.Instant Respawn, pPlayer ); | ||
+ | |||
+ | return 1; | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Pickup/onPickupPickedUp|onPickupPickedUp]] were used in this example. More info about them in the corresponding pages. | |
+ | == Example 2. Setting == | ||
+ | |||
+ | This will set the collected pickup to Instant Respawn. | ||
+ | |||
+ | <code lang="squirrel"> | ||
+ | function onPickupPickedUp( pPlayer, pPickup ) | ||
+ | { | ||
+ | pPickup.InstantRespawn = true; | ||
+ | |||
+ | return 1; | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | === Notes === | ||
+ | |||
+ | 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}} |
Latest revision as of 16:55, 23 October 2010
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:
Bool pickup.InstantRespawn
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
function onPickupPickedUp( pPlayer, pPickup ) { MessagePlayer( "Pickup Instant Respawn: " + pPickup.Instant Respawn, pPlayer ); return 1; }
[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.
function onPickupPickedUp( pPlayer, pPickup ) { pPickup.InstantRespawn = true; return 1; }
[edit] Notes
The event onPickupPickedUp was used in this example. More info about this in the corresponding page.