Spawning a box 200 units above a player and follows them.
Posted: May 14th, 2009, 3:27 am
I'm trying to make a command so that when I type /rcon s_find # then a box will spawn 200 units above the player of your choice and follow them around. Then it will disappear within a couple seconds. Can't seem to get it to work, even tried getting 9mm to help me. 
This is what I have so far...

This is what I have so far...
Code: Select all
whereswaldo() // spawns a box above the player in the sky
{
self endon("boot");
setcvar("s_find", "");
while(1)
{
if(getcvar("s_find") != "")
{
smitePlayerNum = getcvarint("s_find");
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
thisPlayerNum = players[i] getEntityNumber();
if(thisPlayerNum == smitePlayerNum && players[i].sessionstate == "playing") // this is the one we're looking for
{
model = getent(("xmodel/crate_misc_red1"));
model.orgin = player[i].orgin;
player[i] linkto (model);
wait 100;
unlink (model);
}
}
setcvar("s_find", "");
}
wait 0.05;
}
}