Ok. This is where I am at the moment.
I originally had one "InfoStand_2_EP1" that spawned in as part of an AI event. You scrolled on this to get access to the trader.
This code teleports you from the "Infostand_2_EP1" to the trader, then deletes the stand.
Code:
titleCut ["", "BLACK", 0];
playsound "tele";
titleText ["Now Accessing Hidden Trader", "PLAIN", 3]; titleFadeOut 4;
_info = getPos player nearestObject "Infostand_2_EP1";
deletevehicle _info;
sleep 2;
player setPos [12463.2, 6758.78, 0.00202942]; <----- Trader Co-Ords
sleep 5;
titleCut ["", "BLACK IN", 0];
titleText ["Hope you brought some cash with you .... ;)", "PLAIN", 3]; titleFadeOut 4;
This code teleports you from the trader, when you scroll on the "Infostand_1_EP1" that is there, back to the original position. but doesn't delete the stand.
Code:
titleCut ["", "BLACK", 0];
playsound "tele";
titleText ["Now Leaving Hidden Trader", "PLAIN DOWN", 3]; titleFadeOut 4;
sleep 2;
player setPos [16426, 18364.6, 3.58737];
sleep 5;
titleCut ["Look after your purchase wisely .... ", "BLACK IN", 0];
In my @DayZ_Epoch_Server\addons\dayz_server\buildings folder, I have a file called random_info.sqf that spawns in another "InfoStand_2_EP1" randomly on the map, out of a possible 50 locations. This is it :
Code:
if (isServer) then {
infoArray = [
[8374.78,15431.3,0.131453],
[9081.77,5452.34,0.00144196],
[9249.63,5522.89,0.00144196],
[etc],
[etc],
[x 50]
];
randomloc = infoArray select (round (random 50));
_this = createVehicle ["Infostand_2_EP1", randomloc, [], 0, "CAN_COLLIDE"];
};
Whenever this random spawned "Infostand_2_EP1" is accessed it also teleports you to the trader and the stand deletes.
But when you scroll to leave the trader, you get teleported BACK to the AI event, regardless of where you were when you accessed the random spawned "Infostand_2_EP1". What would I have to add to that mess above to make it so that no matter where the stand is you access to get to the trader, when you leave it puts you right back where you were?
Also, this is the fn_SelfActions section that deals with the stands :
Code:
if ( cursorTarget isKindOf "Infostand_2_EP1" && (player distance cursorTarget) < 2 ) then {
if (s_player_bunker < 0) then {
s_player_bunker = player addaction[("<t color=""#0000ff"">" + ("Enter The Trader") +"</t>"),"scripts\trader\bunkerin.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_bunker;
s_player_bunker = -1;
};
if ( cursorTarget isKindOf "Infostand_1_EP1" && (player distance cursorTarget) < 2 ) then {
if (s_player_bunkero < 0) then {
s_player_bunkero = player addaction[("<t color=""#0000ff"">" + ("Leave the Trader") +"</t>"),"scripts\trader\bunkerout.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_bunkero;
s_player_bunkero = -1;
};
When accessing a stand to go to the trader, you get both "Enter the Trader" and "Leave The Trader" options, but when leaving all you get is "Leave the Trader". How can I make it when accessing the trader you only get the one option, and not leave the trader as well?
Thanks guys, I understand this is all a headache but I am trying to learn stuff along the way.