Scripting/Squirrel/Functions/Object.Alpha

From Vice City Multiplayer
Revision as of 11:18, 9 March 2016 by Rathore (talk | contribs) (Created page with "== Syntax == <pre>Object.Alpha = alpha;</pre> == Arguments == '''> Object''' - The pickup instance. * ''integer'' '''alpha''' - The alpha you want to set on object, 0 to 2...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

Syntax

Object.Alpha = alpha;

Arguments

> Object - The pickup instance.

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

Example

This example will create a object and prints its current alpha on console.

function onScriptLoad()
{
   myObject <- CreateObject( 334, 1, Vector( -2261.12, 753.12, 211.123 ),255 );
print(myObject.Alpha);
}

Example 2

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

function onScriptLoad()
{
   myObject <- CreateObject( 334, 1, Vector( -2261.12, 753.12, 211.123 ),255 );
}

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