tele help for cod4

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
Mox09
CJ Wannabe
CJ Wannabe
Posts: 22
Joined: April 9th, 2010, 8:01 am
Location: St louis
Contact:

tele help for cod4

Post by Mox09 » May 28th, 2010, 6:58 pm

Hey guys i got this code from my friend xeno. he made it for his cod1 mod. what it does is when player finds the tele it warps me to part on the map but in my case for cod4 when u spawn it keeps u at this location (-185, -56, 467) and u can't move from that spot and it keeps killing me. can someone help me make it so the player spawns at reg spawn point in the map and then if he walks to this (-185, -56, 4679) he gets warped to (-733, 753, 232) on the map.

Code: Select all

shipment_tele()//teleporter in shipment
{   
   if (getdvar("mapname") == "mp_shipment")
   {
      while(1)
      {
         players = getentarray("player", "classname");
         for(i = 0; i < players.size; i++)
         	players[i] thread teleChecker2();
         wait 0.05;
      }
   }
}

teleChecker2()
{
   if(distance(self.origin,(-185, -56, 467)))
   {
      self setorigin((-733, 753, 232));
   }
}

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: tele help for cod4

Post by Drofder2004 » May 28th, 2010, 8:05 pm

Mox09 wrote:

Code: Select all

teleChecker2()
{
   if(distance(self.origin,(-185, -56, 467))) //WRONG
   {
      self setorigin((-733, 753, 232));
   }
}
You need to do:

Code: Select all

if(distance(self.origin,(-185, -56, 467)) < 25)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests