Scripting/Squirrel/Functions/CreatePickup
This function will create a pickup.
Syntax
1
CreatePickup( model , pos )
2
CreatePickup( model, world, quantity, pos, alpha, isAuto )
3
CreatePickup( model, world, quantity, x, y, z, alpha, isAuto )
Arguments
1
- int model - The model of pickup.
- Vector pos - The pos of pickup.
2
- int model - The model of pickup.
- int world - The world of pickup.
- int quantity - The quantity of pickup.
- Vector pos - The pos of pickup.
- int alpha - The alpha of pickup.
- bool isAuto - (Is auto respawn?)
3
- int model - The model of pickup.
- int world - The world of pickup.
- int quantity - The quantity of pickup.
- float x - The x pos of pickup.
- float y - The y pos of pickup.
- float z - The z pos of pickup.
- int alpha - The alpha of pickup.
- bool isAuto - (Is auto respawn?)
Example 1
The following example will create a pickup. which will be executed by onPickupPickedUp <source lang=squirrel> function onPlayerCommand( player, cmd, text ); {
if ( cmd == "pick1" ) { CreatePickup(368, Vector(player.Pos.x, player.Pos.y, player.Pos.z)); }
} </source>
Example 2
The following example will create a pickup. which will be executed by onPickupPickedUp but could be directly used for few Pickups such as weapons, armour and health <source lang=squirrel> function onPlayerCommand( player, cmd, text ); {
if ( cmd == "armourpick" ) { CreatePickup(368, player.World, 50, Vector(player.Pos.x, player.Pos.y, player.Pos.z), 255, true); }
} </source>
Example 3
The following example will create a pickup without Vector. which will be executed by onPickupPickedUp but could be directly used for few Pickups such as weapons, armour and health <source lang=squirrel> function onPlayerCommand( player, cmd, text ); {
if ( cmd == "armourpick" ) { CreatePickup(368, player.World, 50, player.Pos.x, player.Pos.y, player.Pos.z, 255, true); }
} </source>
Notes
Call onPlayerCommand were used in this example. More info about them in the corresponding pages.
Related Functions
- CreatePickup
- FindPickup