Scripting/Squirrel/Functions/CreateObject: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
This function will create an object. | |||
<pre>CreateObject( model, world, | == Syntax == | ||
{{Scripting/ | |||
<pre>CreateObject( model, world, pos, alpha );</pre> | |||
<pre>CreateObject( model, world, x, y, z , alpha );</pre> | |||
== Arguments == | |||
* ''int'' '''model''' - The object model id | |||
* ''int'' '''world''' - The world id | |||
* ''Vector'' '''pos''' - The object pos | |||
* ''int'' '''alpha''' - The object alpha | |||
== Example == | |||
The following example create an object | |||
<source lang=squirrel> | |||
function onPlayerCommand( player, cmd, text ); | |||
{ | |||
if ( cmd == "obj" ) | |||
{ | |||
CreateObject( 560, player.World, player.Pos, 255); | |||
} | |||
} | |||
</source> | |||
=== Notes === | |||
Call [[onPlayerCommand]] were used in this example. More info about them in the corresponding pages. | |||
== Related Functions == | |||
{{Scripting/Squirrel/Functions/Object_Functions}} |
Revision as of 16:03, 1 November 2014
This function will create an object.
Syntax
CreateObject( model, world, pos, alpha );
CreateObject( model, world, x, y, z , alpha );
Arguments
- int model - The object model id
- int world - The world id
- Vector pos - The object pos
- int alpha - The object alpha
Example
The following example create an object
function onPlayerCommand( player, cmd, text );
{
if ( cmd == "obj" )
{
CreateObject( 560, player.World, player.Pos, 255);
}
}
Notes
Call onPlayerCommand were used in this example. More info about them in the corresponding pages.