Change Map Maker Color on If statement

gr8_boi52

Well-Known Member
hi,

Basically this is what i wana do.

I got custom built millary outposts on the map(cherno) and i have a blue rectangular marker on the map where the area is.

I wanna make a If statement on the marker where when a player enters in the map marked area. The blue marker turns red for all the players on the server. To signify that there is a player in the outpost. And every player leaves the area the marker goes back to blue.

Is this possible? I have seen it in wastleland.
 
All you need is to set a trigger on the right position.
Code:
_trg = createTrigger ["EmptyDetector", [x,y]];
_trg setTriggerArea [400, 400, 0, false];
_trg setTriggerActivation ["ANY", "PRESENT", true];
_trg setTriggerTimeout [5, 10, 15, true];
_trg setTriggerText "Trigger";
_trg setTriggerStatements ['{(isPlayer _x) && (((vehicle _x) isKindOf "Man") or ((vehicle _x) isKindOf "Land"))} count thisList > 0', '"MarkerName" setMarkerColor "ColorRed";', '"MarkerName" setMarkerColor "ColorBlue";'];

replace [x,y] with the coordinates of your Marker:
Code:
_trg = createTrigger ["EmptyDetector", [x,y]];

replace 400,400 with the range of the trigger should be activated:
Code:
_trg setTriggerArea [400, 400, 0, false];

replace 5,10,15 with the minimum, medium, maximum timeout the trigger should be activated, if a player is in range:
Code:
_trg setTriggerTimeout [5, 10, 15, true];

replace "MarkerName" with the name of your marker (2 times)
Code:
_trg setTriggerStatements ['{(isPlayer _x) && (((vehicle _x) isKindOf "Man") or ((vehicle _x) isKindOf "Land"))} count thisList > 0', '"MarkerName" setMarkerColor "ColorRed";', '"MarkerName" setMarkerColor "ColorBlue";'];

the condition activates the trigger, only if the player is on foot, or in a car.

put the entire code in a single sqf file or with your marker code, in the dayz_server.pbo or mission
 
Do I put the name with the underscore eg. "_OutpostA"
Code:
_trg setTriggerStatements ['{(isPlayer _x) && (((vehicle _x) isKindOf "Man") or ((vehicle _x) isKindOf "Land"))} count thisList > 0', '"MarkerName" setMarkerColor "ColorRed";', '"MarkerName" setMarkerColor "ColorBlue";'];
 
The type of the trigger has to be
"EmptyDetector"

The name of a marker shoild be a string, don,t need to be a variable.
_westBase = createMarker ["_West Base", [713.67548, 1872.6334]];
 
should look like that:
Code:
_westBase = createMarker ["WestBase", [713.67548, 1872.6334]];
_westBase setMarkerShape "RECTANGLE";
_westBase setMarkerColor "ColorBlue";
_westBase setMarkerBrush "Solid";
_westBase setMarkerSize [30, 30];
_westBase setMarkerDir 135.12442;
_westBase = _westBase;

_trg1 = createTrigger ["EmptyDetector", [713.67548, 1872.6334]]; // 1 = Triggertype, 2 = position of the trigger (center)
_trg1 setTriggerArea [30, 30, 135.12442, true]; // 1 = horizontal range, 2 = vertical range, 3 = angle, 4 = retangle(true) circle(false)
_trg1 setTriggerActivation ["ANY", "PRESENT", true];
_trg1 setTriggerTimeout [5, 10, 15, true]; // minimal,medium, maximal time the player has to be in the area to turn the trigger on
_trg1 setTriggerText "Trigger";
_trg1 setTriggerStatements ['{(isPlayer _x) && (((vehicle _x) isKindOf "Man") or ((vehicle _x) isKindOf "Land"))} count thisList > 0', '"WestBase" setMarkerColor "ColorRed";', '"WestBase" setMarkerColor "ColorBlue";'];
 
should look like that:
Code:
_westBase = createMarker ["WestBase", [713.67548, 1872.6334]];
_westBase setMarkerShape "RECTANGLE";
_westBase setMarkerColor "ColorBlue";
_westBase setMarkerBrush "Solid";
_westBase setMarkerSize [30, 30];
_westBase setMarkerDir 135.12442;
_westBase = _westBase;

_trg1 = createTrigger ["EmptyDetector", [713.67548, 1872.6334]]; // 1 = Triggertype, 2 = position of the trigger (center)
_trg1 setTriggerArea [30, 30, 135.12442, true]; // 1 = horizontal range, 2 = vertical range, 3 = angle, 4 = retangle(true) circle(false)
_trg1 setTriggerActivation ["ANY", "PRESENT", true];
_trg1 setTriggerTimeout [5, 10, 15, true]; // minimal,medium, maximal time the player has to be in the area to turn the trigger on
_trg1 setTriggerText "Trigger";
_trg1 setTriggerStatements ['{(isPlayer _x) && (((vehicle _x) isKindOf "Man") or ((vehicle _x) isKindOf "Land"))} count thisList > 0', '"WestBase" setMarkerColor "ColorRed";', '"WestBase" setMarkerColor "ColorBlue";'];

Thanks Alot will try it out
 
Back
Top