FindPickup

From Liberty Unleashed Wiki
Revision as of 11:11, 11 October 2010 by VRocker (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function finds a pickup from an ID and returns the pointer. If no pickup is found, null will be returned.

Syntax

  1. Pickup FindPickup( int id )

Arguments

  • id - The ID of the pickup to be found
  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "findpickup" )
  5. {
  6. local pup;
  7. if ( text ) pup = FindPickup( text.tointeger() );
  8.  
  9. if ( pup ) MessagePlayer( "Succesfully found pickup id: " + text + "!", player );
  10. else MessagePlayer( "Unable to find an pickup with id: " + text + "!", player );
  11. }
  12. }
  13.  

This command will try to find the specified pickup id.

Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox