Scripting/Squirrel/Functions/FindObject

From Vice City Multiplayer
Revision as of 20:07, 7 August 2015 by MatheuS (talk | contribs) (→‎Syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

Syntax

FindObject(ID)

Arguments

  • int ID - The ID of the object to find

Example

function onPlayerCommand( player, cmd, text )
{
	if(cmd == "findpickup")
	{
		local pickup = FindPickup(text.tointeger());
		if (pickup)
		{
			pickup.Pos = player.Pos;
			MessagePlayer("[#00FF00]Pickup has been found and has been teleported to you!", player);
		} else {
			MessagePlayer("[#FF0000]Pickup has not been found :(", player);
		}
	}
}

Notes

Call onPlayerCommand was used in this example. More info about it in the page.