Announcement

Collapse
No announcement yet.

simple teleport set distance away from object

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • simple teleport set distance away from object

    This is what I have so far works great but I need the player to be teleported a set distance away from the object say 10m.Yink Unkl

    Code:
    this addaction ["Teleport to MHQcontainer", {_this select 1 setpos getpos MHQcontainer;}];
    May God have mercy upon my enemies, because I won’t.
    -- Gen. George S. Patton


    |TG189th| Cody

  • #2
    The getPos command returns an array in the format [x,y,z]. x = Northing, y = Easting and z = height.

    So you could basically do this:

    Code:
     this addaction ["Teleport to MHQcontainer", {player setPos [(getPos MHQcontainer select 0) +10, getpos MHQcontainer select 1, 0];}];
    This gets the X coordinate and adds 10 meters to it so the player that activates the addAction is always moved 10 meters north of the container.
    Last edited by Unkl; 03-25-2017, 10:10 AM.
    |TG-189th| Unkl
    ArmA 3 Game Officer
    Dean of Tactical Gamer University
    189th Infantry Brigade Member

    SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN

    Comment


    • #3
      x is east and y is north, but otherwise, yeah (origin is lower left corner of the map)

      Comment


      • #4
        Doh! Good correction.

        Sent from my SGH-I337M using Tapatalk

        |TG-189th| Unkl
        ArmA 3 Game Officer
        Dean of Tactical Gamer University
        189th Infantry Brigade Member

        SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN

        Comment

        Connect

        Collapse

        TeamSpeak 3 Server

        Collapse

        Advertisement

        Collapse

        Twitter Feed

        Collapse

        Working...
        X