Jump to content
Sign in to follow this  
daskunk

Side marker visibility

Recommended Posts

I have searched how to do this and found similar scripts but none seem to work I need it to work on a dedicated server. Any help would be most appreciated. i want only the sides to be able to see their markers srvc 1&2 are west srvc 3&4 are east.

What I have

if (!isDedicated) then 
{
{_x setMarkerAlphaLocal 0} forEach ["srvc1","srvc2","srvc3","srvc4"];
waitUntil {!isNull player};
switch (side player) do 
{
	case WEST: 
	{
		{_x setMarkerAlphaLocal 1} forEach ["srvc1","srvc2"];
	};
	case EAST: 
	{
		{_x setMarkerAlphaLocal 1} forEach ["srvc3","srvc4"];
	};
};

Skunk

Edited by DaSkunk
typos

Share this post


Link to post
Share on other sites

Kylania ty for your reply.

According to wiki I need to do this

_markerstr = createMarker["markername",[_Xpos,_Ypos]];
_markerstr setMarkerShape "ICON";
"markername" setMarkerType "DOT";

how do i then do what you said and make them local Kylania ? And what/how do I define the position of the markers. I have trigger areas to start a service script.

Share this post


Link to post
Share on other sites

you create them local to begin with -

createmarker command makes then visible to all - i.e the effects of that command are global and broadcasted to everyone

createmarkerlocal only creates the marker locally - not broadcasted to everyone

since you are not running this script on the server and making one marker which is broadcasted, you are running it on all computers so they all make the said markers locally on their computers - if that makes sense

Share this post


Link to post
Share on other sites

What kind of markers are they? Colors, shape, size, do they say anything? All that. :)

Share this post


Link to post
Share on other sites

ok they are markers from the list in markers service - blufor, square for vehicle and triangle for air. srvc1 is air srvc2 is veh (blufor) srvc3 srvc 4 are air - veh (opfor) They say Air Service Area & Vehicle Service Area for both sides

ty again for your help. Im trying to understand this :)

Share this post


Link to post
Share on other sites

Your code doesn't work?¨

Edit:

You haven't closed the switch with a };

Share this post


Link to post
Share on other sites

I found / came across the code while searching for side markers, i modified the marker names only, as i don't really understand how to do the code.

Share this post


Link to post
Share on other sites

Place your 4 empty markers, svc1 through svc4 where you want the spots to be, then this in your init.sqf:

if (side player == blufor) then {
_mkrBsvc = createMarkerLocal ["mkrBsvc", getMarkerPos "svc1"];
_mkrBsvc setMarkerColorLocal "ColorBlufor";
_mkrBsvc setMarkerShapeLocal "ICON";
_mkrBsvc setMarkerTypeLocal "b_service";
_mkrBsvc setMarkerTextLocal " - Ground Service";

_mkrBair = createMarkerLocal ["mkrBair", getMarkerPos "svc2"];
_mkrBair setMarkerColorLocal "ColorBlufor";
_mkrBair setMarkerShapeLocal "ICON";
_mkrBair setMarkerTypeLocal "b_air";
_mkrBair setMarkerTextLocal " - Air Service";
} else {
_mkrOsvc = createMarkerLocal ["mkrOair", getMarkerPos "svc3"];
_mkrOsvc setMarkerColorLocal "ColorOpfor";
_mkrOsvc setMarkerShapeLocal "ICON";
_mkrOsvc setMarkerTypeLocal "o_service";
_mkrOsvc setMarkerTextLocal " - Ground Service";


_mkrOair = createMarkerLocal ["mkrOsvc", getMarkerPos "svc4"];
_mkrOair setMarkerColorLocal "ColorOpfor";
_mkrOair setMarkerShapeLocal "ICON";
_mkrOair setMarkerTypeLocal "o_air";
_mkrOair setMarkerTextLocal " - Air Service";
};

Share this post


Link to post
Share on other sites

Excellent that worked great. And now i understand the code, thank you very much for your help and patience.

Share this post


Link to post
Share on other sites
I found / came across the code while searching for side markers, i modified the marker names only, as i don't really understand how to do the code.

I can't quote it atm but the switch statement is missing };

2nd line from the bottom.

---------- Post added at 02:16 AM ---------- Previous post was at 02:15 AM ----------

Which makes the script not work but won't spit out any error.

Share this post


Link to post
Share on other sites
I can't quote it atm but the switch statement is missing };

2nd line from the bottom. Which makes the script not work but won't spit out any error.

Bang on m8 tyvm that works also. :)

Amended Code Below

if (!isDedicated) then 
{
{_x setMarkerAlphaLocal 0} forEach ["svc1","svc2","svc3","svc4"];
waitUntil {!isNull player};
switch (side player) do 
{
	case WEST: 
	{
		{_x setMarkerAlphaLocal 1} forEach ["svc1","svc2"];
	};
	case EAST: 
	{
		{_x setMarkerAlphaLocal 1} forEach ["svc3","svc4"];
	};
};
};

Edited by DaSkunk
amended code

Share this post


Link to post
Share on other sites

Hi all, I kind of need help for a similar scenario I am trying to create.

I have tried to inspire myself from your examples above but nothing seems to be doing it.

So I created a small area trigger for BLUFOR which has this code:

if (side player = blufor) then {

_mkrExt1 = createMarkerLocal ["mkrExt1", getMarkerPos "ext1"];

_mkrExt1 setMarkerColorLocal "ColorBlufor";

_mkrExt1 setMarkerShapeLocal "ICON";

_mkrExt1 setMarkerTypeLocal "hd_pickup";

_mkrExt1 setMarkerTextLocal " Extraction point 1";

_mkrExt2 = createMarkerLocal ["mkrExt2", getMarkerPos "ext2"];

_mkrExt2 setMarkerColorLocal "ColorBlufor";

_mkrExt2 setMarkerShapeLocal "ICON";

_mkrExt2 setMarkerTypeLocal "hd_pickup";

_mkrExt2 setMarkerTextLocal " Extraction point 2";

_mkrExt3 = createMarkerLocal ["mkrExt3", getMarkerPos "ext3"];

_mkrExt3 setMarkerColorLocal "ColorBlufor";

_mkrExt3 setMarkerShapeLocal "ICON";

_mkrExt3 setMarkerTypeLocal "hd_pickup";

_mkrExt3 setMarkerTextLocal " Extraction point 3";

};

And it keeps telling me I need a ";"

I'm quite frankly lost here.

The idea is that i have 3 invisible markers named ext1, ext2 and ext3 that are invisible and I would like to create 3 markers VISIBLE ONLY TO BLUFOR out of their positions.

I am very new to scripting in general.

Thank you!:yay:

Share this post


Link to post
Share on other sites

the first line should be

if (side player==West) then {

In ARMA = is used when modifying something, e.g. _a=0, while when checking for an equal value == is used.

Share this post


Link to post
Share on other sites
the first line should be

if (side player==West) then {

In ARMA = is used when modifying something, e.g. _a=0, while when checking for an equal value == is used.

The missing link :P the "==" Thank you so much! Everything works as intended now ;)

Share this post


Link to post
Share on other sites
The missing link :P the "==" Thank you so much! Everything works as intended now ;)

Awesome, glad I could help.

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  

×