Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!
Moderator: Core Staff
-
xeno
- CJ Wannabe

- Posts: 38
- Joined: October 31st, 2007, 12:37 am
- Location: United States - GA
Post
by xeno » 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...
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;
}
}
-
Nightmare
- Core Staff

- Posts: 2688
- Joined: January 12th, 2006, 10:09 pm
-
Contact:
Post
by Nightmare » May 14th, 2009, 3:47 am
Fixed plenty of errors, not tested but should work.
Code: Select all
main(){
precacheModel("xmodel/crate_misc_red1");
thread wheresWaldo();
}
wheresWaldo(){ // spawns a box above the player in the sky
self endon("boot");
setcvar("s_find", "");
while(1){
if(getcvar("s_find") != ""){
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++){
thatPlayer = players[i] getEntityNumber();
if(thatPlayer == getcvarint("s_find"))
if(isAlive(players[i]){
model = spawn("script_model",(0,0,0));
model setModel("xmodel/crate_misc_red1");
model.origin = players[i].origin + (0,0,200);
model linkto(players[i]);
wait 100;
model delete();
}
}
setcvar("s_find", "");
}
wait 0.05;
}
}
-
xeno
- CJ Wannabe

- Posts: 38
- Joined: October 31st, 2007, 12:37 am
- Location: United States - GA
Post
by xeno » May 14th, 2009, 4:23 am
Thank you so much

Users browsing this forum: No registered users and 2 guests