This wiki is using an old backup from 2020
Some information may be old/missing
|
|
Line 1: |
Line 1: |
| | | {{Scripting/Needs_Text}} |
| | | |
| <pre>CreateObject( model, world, Vector( x, y, z ), alpha );</pre> | | <pre>CreateObject( model, world, Vector( x, y, z ), alpha );</pre> |
|
| | {{Scripting/Needs_Example}} |
| == Example ==
| |
| | |
| <source lang=squirrel>
| |
| function onPlayerCommand( player, cmd, text )
| |
| { | |
| if ( cmd == "createobj" )
| |
| {
| |
| if ( player.IsSpawned )
| |
| {
| |
| if ( text )
| |
| {
| |
| local model = text;
| |
| local x = player.Pos.x, y = player.Pos.y, z = player.Pos.z;
| |
| local Pos = Vector( x.tofloat(), y.tofloat(), z.tofloat() );
| |
| CreateObject( model.tointeger(), 0, Vector( x.tofloat(), y.tofloat(), z.tofloat() ), 255 );
| |
| }
| |
| else PrivMessage( player, "/createobj <model id>");
| |
| }
| |
| else PrivMessage( player, "Spawn and then use this command again");
| |
| }
| |
| }
| |
| </source>
| |
Revision as of 18:57, 26 July 2014
![](/images/3/35/Notice.png)
This page needs a description, or needs a better one. Please help us complete the wiki by writing one.
CreateObject( model, world, Vector( x, y, z ), alpha );
![](/images/3/35/Notice.png)
This page needs an example. We will try our best to complete the wiki as soon as possible.