Object.ID

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events


This Object class member returns the ID of the given object.

Syntax

  1. Integer object.ID

Example

This will create a new object and return it's ID when a player types '/object'

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "object" )
  5. {
  6. local pPos = pPlayer.Pos, pObject;
  7. pObject = CreateObject( 1378, pPos.x - 5, pPos.y, pPos.z );
  8. if ( pObject ) MessagePlayer( "Object created with ID " + pObject.ID, pPlayer );
  9. }
  10. return 1;
  11. }
  12.  

Notes

The functions MessagePlayer and Player.Pos and CreateObject and event onPlayerCommand were used in this example. More info about them in the corresponding pages.


Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox