Scripting/Squirrel/Functions/Pickup.Alpha: 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
(Created page with "== Syntax == <pre>vector Pickup.Alpha = Vector( X, Y, Z )</pre> == Arguments == '''> Pickup''' - The pickup instance. '''> Alpha''' - int alpha 0 to 255. == Example == T...")
 
No edit summary
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Syntax ==
== Syntax ==


<pre>vector Pickup.Alpha = Vector( X, Y, Z )</pre>
<pre>Pickup.Alpha = alpha;</pre>


== Arguments ==
== Arguments ==
Line 7: Line 7:
'''> Pickup''' - The pickup instance.
'''> Pickup''' - The pickup instance.


'''> Alpha''' - int alpha 0 to 255.
* ''integer'' '''alpha''' - The alpha you want to set on pickup, 0 to 255.


== Example ==
== Example ==


This example will create a pickup and set its position to the center of map.
This example will create a pickup and you can toggle visible it by commands given below.
 
<pre>function onScriptLoad()
<pre>function onScriptLoad()
{
{
Line 20: Line 19:
function onPlayerCommand(player, cmd, text)
function onPlayerCommand(player, cmd, text)
{
{
if (cmd =="visible')
if (cmd =="visible")
{
{
myPickup.Alpha = 255;
myPickup.Alpha = 255;
MessagePlayer("The pickup is visible now",player);
MessagePlayer("The pickup is visible now",player);
}
}
else if (cmd =="invisible')
else if (cmd =="invisible")
{
{
myPickup.Alpha = 0;
myPickup.Alpha = 0;
Line 32: Line 31:
}
}
</pre>
</pre>
== Related Functions ==
{{Scripting/Squirrel/Functions/Pickup_Functions}}
[[Category:Scripting/Squirrel/Functions/Pickup_Functions]]

Latest revision as of 18:37, 30 January 2017

Syntax

Pickup.Alpha = alpha;

Arguments

> Pickup - The pickup instance.

  • integer alpha - The alpha you want to set on pickup, 0 to 255.

Example

This example will create a pickup and you can toggle visible it by commands given below.

function onScriptLoad()
{
   myPickup <- CreatePickup( 284, 1, Vector( -2261.12, 753.12, 211.123 ) );
}

function onPlayerCommand(player, cmd, text)
{
if (cmd =="visible")
{
myPickup.Alpha = 255;
MessagePlayer("The pickup is visible now",player);
}
else if (cmd =="invisible")
{
myPickup.Alpha = 0;
MessagePlayer("The pickup is invisible now",player);
}
}

Related Functions