Okay so I am interested in setting up a roaming trader that only moves after every restart and sells high-end weapons/vehicles. If anyone has a way to help or contribute please feel free.
**This is not my script** This work is Inkko's
/*-----------------------------------
|Roaming Trader (RT) Script by Inkko |
[] execVM "script.sqf"; bottom of server_functions.sqf
-----------------------------------*/
//Config
RT_TraderArray = ["Functionary2","RU_Functionary1","CIV_EuroMan02_EP1","GUE_Soldier_MG","RU_WorkWoman5","RU_Citizen1","menu_CIV_EuroMan01_EP1","RU_Profiteer4","Woodlander3","Doctor","GUE_Woodlander2","HouseWife1"]; // list of traders that are randomly chosen
RT_MaxDistance = 6000; // Max distance away from center of map to look for safe spot
RT_CloseObject = 30; // Max distance to closest object; BIS_fnc_findSafePos
RT_Timer = 900; // random number between 0-900, added to RT_Timer2 for fluctuating times.
RT_Timer2 = 300; // Base wait time.
RT_Wait = 120; // delay for warning that trader will move soon.
RT_Wait2 = 360; // Time till new trader shows up once previous trader has been deleted. Random number between 0-360.
RT_Color = "ColorBlack"; // Color of marker
RT_SpawnedMessage = "Roaming trader has setup on the map."; // message broadcast when trader spawns
RT_LeaveSoonMessage = "The roaming trader is about to travel to a new location."; // warning that trader will move soon.
RT_MovedMessage = "Roaming trader has packed up and is looking for a new spot."; // Broadcasts that trader has moved and looking for new spot.
//Config End
RT_Counter = 0;
uisleep 200; //intial delay before trader sets up.
// Locates correct text for trader skin selected. Change text based on what your traders are setup for.
if (RT_TraderType == "Functionary2") then {RT_Text="Gem Trader";};
if (RT_TraderType == "RU_Functionary1") then {RT_Text="Hero Trader";};
if (RT_TraderType == "CIV_EuroMan02_EP1") then {RT_Text="Ammunition Trader";};
if (RT_TraderType == "GUE_Soldier_MG") then {RT_Text="Bandit Trader";};
if (RT_TraderType == "RU_WorkWoman5") then {RT_Text="Supply Trader";};
if (RT_TraderType == "RU_Citizen1") then {RT_Text="Wholesaler";};
if (RT_TraderType == "menu_CIV_EuroMan01_EP1") then {RT_Text="Weapon Trader";};
if (RT_TraderType == "RU_Profiteer4") then {RT_Text="Vehicle Trader";};
if (RT_TraderType == "Woodlander3") then {RT_Text="Building Supply Trader";};
if (RT_TraderType == "Doctor") then {RT_Text="Medical Trader";};
if (RT_TraderType == "HouseWife1") then {RT_Text="Special Trader";};
if (RT_TraderType == "GUE_Woodlander2") then {RT_Text="Black Market Weapons";};
// start timer functions, broadcasts, and logs
_mapgrid = mapGridPosition RT_Location;
diag_log format["Roaming Trader: Spawned at grid %1, trader type selected as %2 trader type %3", _mapgrid, RT_TraderType, RT_Text];
[nil,nil,rTitleText,RT_SpawnedMessage,"PLAIN",10] call RE;
RT_Active = true;
// marker loop to keep marker active while trader is around
[] spawn {
while {RT_Active} do {
_mrk = createmarker ["Special_Trader",RT_Location];
_mrk setmarkertype "mil_dot";
_mrk setMarkerSize [1, 1];
_mrk setmarkercolor RT_Color;
_mrk setMarkerText RT_Text;
sleep 30;
deletemarker "Special_Trader";
};
};
_cleanuptimer = round (random RT_Timer);
_cleanuptimer = _cleanuptimer + RT_Timer2;
diag_log format["Roaming Trader: (%5) Spawned at grid %1, trader type selected as %2 trader type %3 for %4 seconds", _mapgrid, RT_TraderType, RT_Text,_cleanuptimer,RT_Counter];
Question
Longshot03XX
Okay so I am interested in setting up a roaming trader that only moves after every restart and sells high-end weapons/vehicles. If anyone has a way to help or contribute please feel free.
**This is not my script** This work is Inkko's
Some issues that I've ran into so far are just the design of the trader and it being underground or not spawning on leveled ground.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now