Scripting/Squirrel/Functions/Pickups/IsSpawned

From VC-MP Wiki

Jump to: navigation, search

This instance variable returns whether or not the pickup is spawned.

Syntax

bool pickup.IsSpawned

Example

This example will tell the player whether a pickup is spawned or not when they type /c pickup 1.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "pickup" )
     {
        local Pickup = FindPickup( text );
 
        if ( Pickup.IsSpawned ) MessagePlayer( "This pickup is spawned.", player )
        else MessagePlayer( "This pickup hasn't spawned.", player )
     }
}

Notes

The functions MessagePlayer, FindPickup and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
squirrel scripting