Where I put it in the script?
function serverCmdDoBotIcon( %client, %data )
{
if( !%client.isSuperAdmin )
return;
// make sure the dataBlock exists
if( !isObject( %data ) )
{
error( "Couldn't find" SPC %data );
return 0;
}
// clear old bot icon brick
if( isObject( $botIconBrick ) )
{
$botIconBrick.botHolder.delete();
$botIconBrick.botHolder = 0;
$botIconBrick.hBot.delete();
$botIconBrick.hBot = 0;
$botIconBrick.delete();
$botIconBrick = 0;
}
%pos = "0 10 -1005";
// should probably take into consideration the rotate adjust thing
%rot = "0 0 -1 90";
// create the bot brick
%brick = new fxDTSBrick()
{
position = %pos;
rotation = %rot;
dataBlock = %data;
angleId = 1;
colorId = 5;
colorFxId = 0;
shapeFxId = 0;
isPlanted = 1;
client = %client;
};
// remember the brick we made
$botIconBrick = %brick;
%error = %brick.plant();
%brick.setTrusted(1);
%client.brickGroup.add( %brick );
// make sure the brick is rendering
%brick.scheduleNoQuota( 1000, setRendering, 1 );
// set hBot type since we're doing this out of onplant
%brick.hBotType = %data.holeBot;
// create the static shape that will hold the bot in place, honestly I'm unsure why there are no collision meshes in icon mode
%static = new staticShape()
{
dataBlock = emptyBotHolderShape;
position = vectorAdd( %pos, "0 0 0.225" );
rotation = %rot;
};
missionCleanup.add( %static );
%brick.botHolder = %static;
// spawn the bot
%bot = %brick.spawnHoleBot();
%bot.updateArm(%bot.dataBlock.hWep);
%bot.setWeapon(%bot.dataBlock.hWep);
%bot.stopHoleLoop();
%static.mountObject( %bot, 0 );
return 1;
}