Squirrel/Server/Functions/Pickups/ID
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|Pickup.ID}} __NOTOC__ This ''Pickup'' class member returns the ID of the given pickup. == Syntax == <code>Integer pickup.ID</code> == Example == {{Squirrel/Ne…') |
(→Example) |
||
Line 8: | Line 8: | ||
== Example == | == Example == | ||
− | + | This will tell the player what pickup ID they just picked up. | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPickupPickedUp( pPlayer, pPickup ) | |
+ | { | ||
+ | MessagePlayer( "Pickup ID: " + pPickup.ID, 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. | |
− | + | ||
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Pickups}} | {{Squirrel/Server/Functions/Pickups}} |
Latest revision as of 17:43, 23 October 2010
This Pickup class member returns the ID of the given pickup.
[edit] Syntax
Integer pickup.ID
[edit] Example
This will tell the player what pickup ID they just picked up.
function onPickupPickedUp( pPlayer, pPickup ) { MessagePlayer( "Pickup ID: " + pPickup.ID, pPlayer ); return 1; }
[edit] Notes
The function MessagePlayer and event onPickupPickedUp were used in this example. More info about them in the corresponding pages.