Jump to content
Sign in to follow this  
DesolateChris

Script to Teleport to HQ

Recommended Posts

Hey there,

I'm assuming for an advanced scripter this will be relatively easy (I hope I'm right)

Basically I want to set up a flagpole teleporter that will teleport players to a specified vehicle (in this case, a LAV-25A2 (HQ)).

Thank you tonnes in advance :)

Share this post


Link to post
Share on other sites

hey DesolateChris if you do a fast google search you will find a few hits that my help you.

1. I have 2 working MHQ's in this mission

http://forums.bistudio.com/showthrea...ON-main-thread (GOOGLE)

2. Mobile Respawn MHQ if you type this on the search on this site you will get a few other demo missions/scripts with working mobile Respawns.

Share this post


Link to post
Share on other sites

This script has been around for a while, so I am unsure of the author. That said, it's pretty darned simple. I have edited it to get an object position instead of a marker position.

Create a file named "teleport.sqf" in your mission folder.

teleport.sqf:

//this addAction ["Teleport -destinationName","teleport.sqf",[objectName]];

// Get the destination.
_dest = (_this select 3) select 0;

// Get a random direction
_dir = random 359;

// Move the person a few meters away from the destination (in the direction of _dir)
player SetPos [(getPos _dest select 0)-10*sin(_dir),(getPos _dest select 1)-10*cos(_dir)];

Name your LAV - I'll name it "MHQ1" for this example.

Place a flagpole. Enter the addAction (with proper names) in the flagpole's init line:

this addAction ["Teleport - MHQ","teleport.sqf",[MHQ1]];

That's it. The flagpole will teleport you to the general vicinity of the MHQ (within a few meters). The only thing this doesn't do is check if the MHQ is active/moving, though teleporting to the MHQ while it is moving works fine.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×