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 11: | Line 11: | ||
{ | { | ||
local model = text; | local model = text; | ||
local x = player.Pos.x, y = player.Pos.y, z = player.Pos.z; | local x = player.Pos.x, y = player.Pos.y, z = player.Pos.z; | ||
local Pos = Vector( x.tofloat(), y.tofloat(), z.tofloat() ); | local Pos = Vector( x.tofloat(), y.tofloat(), z.tofloat() ); | ||
CreateObject( model.tointeger(), 0, Vector( x.tofloat(), y.tofloat(), z.tofloat() ), 255 ); | CreateObject( model.tointeger(), 0, Vector( x.tofloat(), y.tofloat(), z.tofloat() ), 255 ); | ||
} | } | ||
else PrivMessage( player, "/createobj <model id>"); | else PrivMessage( player, "/createobj <model id>"); |
Revision as of 13:22, 26 July 2014
CreateObject( model, world, Vector( x, y, z ), alpha );
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");
}