Scripting/Squirrel/Functions/Pickups/FindPickup

From VC-MP Wiki

Jump to: navigation, search

This function finds a specified pickup ID.

Syntax

string FindPickup( ID )

Arguments

ID - The ID of the pickup to be found.

Example

This will message the player if it finds a pickup when /c findpickup 1 is typed.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "findpickup" )
     {
          if ( FindPickup( text ) ) MessagePlayer( "Pickup found!", player )
          else MessagePlayer( "Unable to find pickup!", player )
     }
}

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about these in the corresponding pages.

Related Functions

Personal tools
squirrel scripting