Scripting/Squirrel/Functions/Object.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>Object.Alpha = alpha;</pre> == Arguments == '''> Object''' - The pickup instance. * ''integer'' '''alpha''' - The alpha you want to set on object, 0 to 2...")
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Syntax ==
== Syntax ==


<pre>Object.Alpha = alpha;</pre>
<pre>Object.Alpha;</pre>


== Arguments ==
== Arguments ==


'''> Object''' - The pickup instance.
'''> Object''' - The object instance.
 
* ''integer'' '''alpha''' - The alpha you want to set on object, 0 to 255.


== Example ==
== Example ==


This example will create a object and prints its current alpha on console.
This example will create a object and prints its current alpha on console.
<pre>function onScriptLoad()
<source lang=squirrel>
function onScriptLoad()
{
{
   myObject <- CreateObject( 334, 1, Vector( -2261.12, 753.12, 211.123 ),255 );
   myObject <- CreateObject( 334, 1, Vector( -2261.12, 753.12, 211.123 ),255 );
print(myObject.Alpha);
print(myObject.Alpha);
}
}
</pre>
</source>


== Example 2 ==
== Related Functions ==
 
This example will create a object and you can toggle visible it by commands given below.
<pre>function onScriptLoad()
{
  myObject <- CreateObject( 334, 1, Vector( -2261.12, 753.12, 211.123 ),255 );
}


function onPlayerCommand(player, cmd, text)
{{Scripting/Squirrel/Functions/Object_Functions}}
{
[[Category:Scripting/Squirrel/Functions/Object_Functions]]
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);
}
}
</pre>

Latest revision as of 18:35, 30 January 2017

Syntax

Object.Alpha;

Arguments

> Object - The object instance.

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

Related Functions