Jump to content
  • 0

Teleporter to teleport from A to B (or scroll option with multiple choice)


seeker619

Question

I remember a year or so go when i was running a few dayz servers, there was a new addon that had put the dogs in for taming for the first time.  and Some weird "back story" to the server.. Something to do with a scientist and there was this place in the north you had to find, like a science lab or some shit..

 

ANYWAY,  inside that science lab were teleporters, that would take you wherever...

 

ANYWAY AGAIN,  Where would i begin?  Point A, stand on it and either a confirmation comes up to click yes or no, or a timer that says move with in X seconds if you do not wish to teleport, or a spin wheel option with multiple destination to choose from.

 

(if youre wondering WHY would you want to do that.. I was thinking maybe a donator perk, or for people with multiple bases to be able to go from 1 to another) or whatever, havent decided what i would do with it if anything.. but can it be done?

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Test it.

 

fn_SelfActions.sqf

_teleports_locations =
[
[3315.73,10776.2,0.0,"Bunker", 5615.73,10776.2,0.0 ],
[3615.76,10776.2,0.0,"Moscow Metro" 5615.73,10776.2,0.0 ],
[3915.79,10776.2,0.0,"Montgomery" 5615.73,10776.2,0.0 ]
];

{
	if ((player distance [_x select 0, _x select 1, _x select 2]) < 3) then { // 3 - Teleport checkpoint radius
		if (s_player_onteleport < 0) then { 
				s_player_onteleport = player addAction [format["Move in %1"], (_x select 3),"scripts\teleporter.sqf",[_x], 6, false, true,"",""];
				} else {
				player removeAction s_player_onteleport;
				s_player_onteleport = 		-1;
				};
			};
} forEach _teleports_locations;

teleporter.sqf

player setPos [ _this select 0, _this select 1, _this select 2];
diag_log format["Player %1 teleported to %2",player, _this select 3]; 
Edited by lmapper
Link to comment
Share on other sites

  • 0

s_player_onteleport

 

how would i designate an object or location as s_player_"""onteleport"""? (if i think what i know is correct,  this:

if (s_player_onteleport < 0) then { 

is a check? to verify that condition """onteleport""" exists, and if so it will move on.. it seems something is missing.  now this im not sure how it works. But, how do you assign an area or object to carry the ."teleport?" tag. (or is "on" not an actual check\function?? and "onteleport" is the variable/tag.. sorry i dont know the correct terminology

 

sorry, i get it.. pretty straight forward.

Edited by seeker619
Link to comment
Share on other sites

  • 0

let me word it differently, where is the player going to find the teleporter? how would i add the teleporter in the game? or are the 3 locations the teleporters? and i would just change the locs to where i want them to be?

 

nm i get it all now.

going to test it.

Edited by seeker619
Link to comment
Share on other sites

  • 0

is a check? to verify that condition """onteleport""" exists, and if so it will move on.. it seems something is missing.  now this im not sure how it works. But, how do you assign an area or object to carry the ."teleport?" tag. (or is "on" not an actual check\function?? and "onteleport" is the variable/tag.. sorry i dont know the correct terminology

Oh, god.

Dude, what are you talking about? 

 

s_player_onteleport its just name for addaction toggle.

With the help of these things in the code to check whether this action is shown to the player.

If it is removed, then when he is standing next to a checkpoint - it is infinitely will be added new actions.

Link to comment
Share on other sites

  • 0

let me word it differently, where is the player going to find the teleporter? how would i add the teleporter in the game? or are the 3 locations the teleporters? and i would just change the locs to where i want them to be?

 

nm i get it all now.

going to test it.

 

Wait, I forgot the coordinates of the point where the player gets.

Link to comment
Share on other sites

  • 0

Ok. Let's see:

 

fn_selfactions.sqf

_teleports_locations =
[
[3315.73,10776.2,0.0,   "Bunker",        5615.73,10776.2,0.0],
[3615.76,10776.2,0.0,   "Moscow Metro",   5615.73,10776.2,0.0],
[3915.79,10776.2,0.0,   "Montgomery",     5615.73,10776.2,0.0]
];

{
	if ((player distance [_x select 0, _x select 1, _x select 2]) < 3) then { // 3 - Teleport checkpoint radius
		if (s_player_onteleport < 0) then { 
				s_player_onteleport = player addAction [format["Move in %1"], (_x select 3),"scripts\teleporter.sqf",[_x], 6, false, true,"",""];
				} else {
				player removeAction s_player_onteleport;
				s_player_onteleport = 		-1;
				};
			};
} forEach _teleports_locations;

teleporter.sqf

player setPos [ _this select 4, _this select 5, _this select 6];
diag_log format["Player %1 teleported to %2",player, _this select 3]; 

All teleporters are configured in the "_teleports_locations =", now show you how:

[x,y,z"The destination point name", x,y,z ],

   /\                                                                     /\

First x,y,z is the point of departure coords.     Second x,y,z is the destination point coords.

 

 

I can also come in handy this code, but I have no way to test it. Test it and tell me if there are any errors, or if you do not understand something.

Link to comment
Share on other sites

  • 0

sorry, longgg weekend with cinco de mayo and shit.. gonna throw it up and test it on my napf server.   so i guess the easiest way for me to get the locs, is to add something to the map... like a firebarrel.. and check the database for its location, then use that loc as the _teleports_locations =.. right?  or is the loc in the database the wrong format?

Link to comment
Share on other sites

  • 0

Hey man, I was trying this but it's not working, would you have any idea what's wrong? I whitelisted it in AH, put it in fn_selfactions, but nothing =/

 

http://pastebin.com/9SnqHCDd

 

Any idea what's wrong? I pasted it under these lines in fn_selfactions:

_onLadder =		(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

It doesn't show up any error in clientRPT or serverRPT, and it just doesn't show the addaction, nothing. Even with player distance 100, it doesn't change anything

Link to comment
Share on other sites

  • 0

Hey man, I was trying this but it's not working, would you have any idea what's wrong? I whitelisted it in AH, put it in fn_selfactions, but nothing =/

 

http://pastebin.com/9SnqHCDd

 

Any idea what's wrong? I pasted it under these lines in fn_selfactions:

_onLadder =		(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

It doesn't show up any error in clientRPT or serverRPT, and it just doesn't show the addaction, nothing. Even with player distance 100, it doesn't change anything

 

im already write not bat teleporting system, but i need time for test it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...