Home   Help Search Login Register  

Author Topic: Cannot teleport vehicle...  (Read 731 times)

0 Members and 1 Guest are viewing this topic.

kevind2003

  • Guest
Cannot teleport vehicle...
« on: 05 Jan 2004, 09:59:29 »
Hi,

I can teleport player by setpos, but it doesn't work on the vehicle, any ideas? the unit is inside the vehicle, I want they can teleport at same time

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Cannot teleport vehicle...
« Reply #1 on: 05 Jan 2004, 11:36:01 »
What code do u write?

kevind2003

  • Guest
Re:Cannot teleport vehicle...
« Reply #2 on: 05 Jan 2004, 12:03:32 »
_nearestvehicle = NearestObject [player, "M1A1"]

?(player in _nearestvehicle): goto "Teleport"

Exit

#Teleport

onMapSingleClick {player setpos _pos; _nearestvehicle setpos _pos; onMapSingleClick {null}}

Quid Novi

  • Guest
Re:Cannot teleport vehicle...
« Reply #3 on: 05 Jan 2004, 12:54:06 »
Code: [Select]
onMapSingleClick {player setpos _pos; _nearestvehicle setpos _pos; onMapSingleClick {null}}

think it might work like this:

Code: [Select]
onMapSingleClick {player setpos (getpos _pos); _nearestvehicle setpos (getpos _pos); onMapSingleClick {null}}

thats all i can think of  :-\

kevind2003

  • Guest
Re:Cannot teleport vehicle...
« Reply #4 on: 05 Jan 2004, 13:16:34 »
umm... sorry it doesn't work, _pos is the position array returned by onmapsingleclick, it's not an object, getpos only can get the position of an object  :-\

Offline Burn

  • Members
  • *
Re:Cannot teleport vehicle...
« Reply #5 on: 05 Jan 2004, 13:34:17 »
DeadDog helped me with this once:
Quote
You will have to move the vehicle, as well as the crew.

Try this:

"(vehicle _X) setPos getMarkerPos {Marker}" forEach units agrp

What will happen here is that the vehicle the unit is in (or just the unit if it is not in a vehicle) will get moved.  Say you have 1 tank in a group.  It will actually get setpositioned three times because there are three crew members.  You will not be able to tell any difference, however.
that should wok just fine ;)...

Quid Novi

  • Guest
Re:Cannot teleport vehicle...
« Reply #6 on: 05 Jan 2004, 13:53:22 »
umm... sorry it doesn't work, _pos is the position array returned by onmapsingleclick, it's not an object, getpos only can get the position of an object  :-\

point taken  ;)

kevind2003

  • Guest
Re:Cannot teleport vehicle...
« Reply #7 on: 05 Jan 2004, 15:27:55 »
DeadDog helped me with this once:that should wok just fine ;)...

Yes it's working now, thanks