Scripting/Squirrel/Functions/CreatePickup: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(This command creates a pickup on Player Pos)
 
No edit summary
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  else if ( cmd == "keycard" )
This function will create a pickup.
{
 
    if ( player.Name == "Your name" )  
== Syntax ==
    {
 
            CreatePickup( 508, Vector( ( player.Pos.x + 2 ), player.Pos.y, player.Pos.z + 1 ) );
'''1'''
            ClientMessageToAll( "Admin [ " + player.Name + " ] created KeyCard in the region - " + GetDistrictName( player.Pos.x, player.Pos.y ) , 255, 400, 300  );
<pre>CreatePickup( model , pos )</pre>
    }
'''2'''
else MessagePlayer( "[#ffffff][INFO] [#00ff00]Your are not admin." , player );
<pre>CreatePickup( model, world, quantity, pos, alpha, isAuto )</pre>
}
'''3'''
<pre>CreatePickup( model, world, quantity, x, y, z, alpha, isAuto )</pre>
 
== 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 ==
 
{{Scripting/Squirrel/Functions/Pickup_Functions}}
[[Category:Scripting/Squirrel/Functions/Pickup_Functions]]

Latest revision as of 18:36, 30 January 2017

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

function onPlayerCommand( player, cmd, text );
{
 if ( cmd == "pick1" )
 {
  CreatePickup(368, Vector(player.Pos.x, player.Pos.y, player.Pos.z));
 }
}

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

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);
 }
}


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

function onPlayerCommand( player, cmd, text );
{
 if ( cmd == "armourpick" )
 {
  CreatePickup(368, player.World, 50, player.Pos.x, player.Pos.y, player.Pos.z, 255, true);
 }
}

Notes

Call onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions