FindObject
From Liberty Unleashed Wiki
This function finds an object from an ID and returns the pointer. If no object is found, null will be returned.
Syntax
Object FindObject( int id )
Arguments
- id - The ID of the object to be found
Example
function onPlayerCommand( player, cmd, text ) { if ( cmd == "findobj" ) { local obj; if ( text ) obj = FindObject( text.tointeger() ); if ( obj ) MessagePlayer( "Succesfully found object id: " + text + "!", player ); else MessagePlayer( "Unable to find an object with id: " + text + "!", player ); } }
This command will try to find the specified object id.
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.