Jump to content
Sign in to follow this  
logitrust

if (!isDedicated) then marker error (case GUER:)

Recommended Posts

Hi, adding some markers only visible for each playable side to a misison, all good but getting a error with "-ShowScriptErrors" when spawning as resistance aka. greenfor on our dedicated server. All markers showing and no errors on other faction sides.

All feedback is cool, cheers!

Error msg:

pj8h.png

Ok, here we go:

init.sqf:

if (!isDedicated) then 
{
{_x setMarkerAlphaLocal 0} forEach ["mkrA","mkrB","mkrC","mkrD","mkrE","mkrF","mkrG","mkrH","mkrI","mkrJ","mkrK","mkrL","mkrM","mkrN","mkrO","mkrP","mkrQ","mkrR","mkrS","mkrT","mkrU","mkrV","mkrW","mkrX","mkrY","mkrZ"];
waitUntil {!isNull player};
switch (side player) do 
{
	case WEST: 
	{
		{_x setMarkerAlphaLocal 1} forEach ["mkrA","mkrB","mkrC"];
	};
	case EAST: 
	{
		{_x setMarkerAlphaLocal 1} forEach ["mkrD","mkrE","mkrF","mkrG","mkrH","mkrI","mkrJ","mkrK","mkrL"];
	};
	case GUER:
	{
		{_x setMarkerAlphaLocal 1} forEach ["mkrM","mkrN","mkrO","mkrP"];
	};
	case CIVILIAN: 
	{
		{_x setMarkerAlphaLocal 1} forEach ["mkrQ","mkrR","mkrS","mkrT","mkrU","mkrV","mkrW","mkrX","mkrY","mkrZ"];
	};
};
[] execVM "scripts\markers.sqf";
};

scripts\markers.sqf:

if (side player == blufor) then {
   _mkrA = createMarkerLocal ["mkrA", getMarkerPos "mil_dot_blufor_01"];
   _mkrA setMarkerColorLocal "ColorBlue";
   _mkrA setMarkerShapeLocal "ICON";
   _mkrA setMarkerTypeLocal "mil_triangle";
   _mkrA setMarkerTextLocal "";

   _mkrB = createMarkerLocal ["mkrB", getMarkerPos "mil_dot_blufor_02"];
   _mkrB setMarkerColorLocal "ColorBlue";
   _mkrB setMarkerShapeLocal "ICON";
   _mkrB setMarkerTypeLocal "mil_triangle";
   _mkrB setMarkerTextLocal "";

   _mkrC = createMarkerLocal ["mkrC", getMarkerPos "mil_dot_blufor_03"];
   _mkrC setMarkerColorLocal "ColorBlue";
   _mkrC setMarkerShapeLocal "ICON";
   _mkrC setMarkerTypeLocal "mil_triangle";
   _mkrC setMarkerTextLocal "";
};

if (side player == opfor) then {
   _mkrD = createMarkerLocal ["mkrD", getMarkerPos "mil_dot_east_01"];
   _mkrD setMarkerColorLocal "ColorRed";
   _mkrD setMarkerShapeLocal "ICON";
   _mkrD setMarkerTypeLocal "mil_triangle";
   _mkrD setMarkerTextLocal "";

   _mkrE = createMarkerLocal ["mkrE", getMarkerPos "mil_dot_east_02"];
   _mkrE setMarkerColorLocal "ColorRed";
   _mkrE setMarkerShapeLocal "ICON";
   _mkrE setMarkerTypeLocal "mil_triangle";
   _mkrE setMarkerTextLocal "";

   _mkrF = createMarkerLocal ["mkrF", getMarkerPos "mil_dot_east_03"];
   _mkrF setMarkerColorLocal "ColorRed";
   _mkrF setMarkerShapeLocal "ICON";
   _mkrF setMarkerTypeLocal "mil_triangle";
   _mkrF setMarkerTextLocal "";

   _mkrG = createMarkerLocal ["mkrG", getMarkerPos "mil_dot_east_04"];
   _mkrG setMarkerColorLocal "ColorRed";
   _mkrG setMarkerShapeLocal "ICON";
   _mkrG setMarkerTypeLocal "mil_triangle";
   _mkrG setMarkerTextLocal "";

_mkrH = createMarkerLocal ["mkrH", getMarkerPos "mil_dot_east_05"];
   _mkrH setMarkerColorLocal "ColorRed";
   _mkrH setMarkerShapeLocal "ICON";
   _mkrH setMarkerTypeLocal "mil_triangle";
   _mkrH setMarkerTextLocal "";

_mkrI = createMarkerLocal ["mkrI", getMarkerPos "mil_dot_east_06"];
   _mkrI setMarkerColorLocal "ColorRed";
   _mkrI setMarkerShapeLocal "ICON";
   _mkrI setMarkerTypeLocal "mil_triangle";
   _mkrI setMarkerTextLocal "";

_mkrJ = createMarkerLocal ["mkrJ", getMarkerPos "mil_dot_east_07"];
   _mkrJ setMarkerColorLocal "ColorRed";
   _mkrJ setMarkerShapeLocal "ICON";
   _mkrJ setMarkerTypeLocal "mil_triangle";
   _mkrJ setMarkerTextLocal "";

_mkrK = createMarkerLocal ["mkrK", getMarkerPos "mil_dot_east_08"];
   _mkrK setMarkerColorLocal "ColorRed";
   _mkrK setMarkerShapeLocal "ICON";
   _mkrK setMarkerTypeLocal "mil_triangle";
   _mkrK setMarkerTextLocal "";

_mkrL = createMarkerLocal ["mkrL", getMarkerPos "mil_dot_east_09"];
   _mkrL setMarkerColorLocal "ColorRed";
   _mkrL setMarkerShapeLocal "ICON";
   _mkrL setMarkerTypeLocal "mil_triangle";
   _mkrL setMarkerTextLocal "";
};

if (side player == resistance) then {
   _mkrM = createMarkerLocal ["mkrM", getMarkerPos "mil_dot_green_01"];
   _mkrM setMarkerColorLocal "ColorGreen";
   _mkrM setMarkerShapeLocal "ICON";
   _mkrM setMarkerTypeLocal "mil_triangle";
   _mkrM setMarkerTextLocal "";

   _mkrN = createMarkerLocal ["mkrN", getMarkerPos "mil_dot_green_02"];
   _mkrN setMarkerColorLocal "ColorGreen";
   _mkrN setMarkerShapeLocal "ICON";
   _mkrN setMarkerTypeLocal "mil_triangle";
   _mkrN setMarkerTextLocal "";

   _mkrO = createMarkerLocal ["mkrO", getMarkerPos "mil_dot_green_03"];
   _mkrO setMarkerColorLocal "ColorGreen";
   _mkrO setMarkerShapeLocal "ICON";
   _mkrO setMarkerTypeLocal "mil_triangle";
   _mkrO setMarkerTextLocal "";

   _mkrP = createMarkerLocal ["mkrP", getMarkerPos "mil_dot_green_04"];
   _mkrP setMarkerColorLocal "ColorGreen";
   _mkrP setMarkerShapeLocal "ICON";
   _mkrP setMarkerTypeLocal "mil_triangle";
   _mkrP setMarkerTextLocal "";
};

if (side player == civilian) then {
   _mkrQ = createMarkerLocal ["mkrQ", getMarkerPos "mil_dot_depot_01"];
   _mkrQ setMarkerColorLocal "ColorWhite";
   _mkrQ setMarkerShapeLocal "ICON";
   _mkrQ setMarkerTypeLocal "mil_triangle";
   _mkrQ setMarkerTextLocal "";

   _mkrR = createMarkerLocal ["mkrR", getMarkerPos "mil_dot_depot_02"];
   _mkrR setMarkerColorLocal "ColorWhite";
   _mkrR setMarkerShapeLocal "ICON";
   _mkrR setMarkerTypeLocal "mil_triangle";
   _mkrR setMarkerTextLocal "";

   _mkrS = createMarkerLocal ["mkrS", getMarkerPos "mil_dot_depot_03"];
   _mkrS setMarkerColorLocal "ColorWhite";
   _mkrS setMarkerShapeLocal "ICON";
   _mkrS setMarkerTypeLocal "mil_triangle";
   _mkrS setMarkerTextLocal "";

   _mkrT = createMarkerLocal ["mkrT", getMarkerPos "mil_dot_depot_04"];
   _mkrT setMarkerColorLocal "ColorWhite";
   _mkrT setMarkerShapeLocal "ICON";
   _mkrT setMarkerTypeLocal "mil_triangle";
   _mkrT setMarkerTextLocal "";

_mkrU = createMarkerLocal ["mkrU", getMarkerPos "mil_dot_depot_05"];
   _mkrU setMarkerColorLocal "ColorWhite";
   _mkrU setMarkerShapeLocal "ICON";
   _mkrU setMarkerTypeLocal "mil_triangle";
   _mkrU setMarkerTextLocal "";

_mkrV = createMarkerLocal ["mkrV", getMarkerPos "mil_dot_depot_06"];
   _mkrV setMarkerColorLocal "ColorWhite";
   _mkrV setMarkerShapeLocal "ICON";
   _mkrV setMarkerTypeLocal "mil_triangle";
   _mkrV setMarkerTextLocal "";

_mkrW = createMarkerLocal ["mkrW", getMarkerPos "mil_dot_camp_07"];
   _mkrW setMarkerColorLocal "ColorWhite";
   _mkrW setMarkerShapeLocal "ICON";
   _mkrW setMarkerTypeLocal "mil_box";
   _mkrW setMarkerTextLocal "";

_mkrX = createMarkerLocal ["mkrX", getMarkerPos "mil_dot_camp_08"];
   _mkrX setMarkerColorLocal "ColorWhite";
   _mkrX setMarkerShapeLocal "ICON";
   _mkrX setMarkerTypeLocal "mil_box";
   _mkrX setMarkerTextLocal "";

_mkrY = createMarkerLocal ["mkrY", getMarkerPos "mil_dot_camp_09"];
   _mkrY setMarkerColorLocal "ColorWhite";
   _mkrY setMarkerShapeLocal "ICON";
   _mkrY setMarkerTypeLocal "mil_box";
   _mkrY setMarkerTextLocal "";

_mkrZ = createMarkerLocal ["mkrZ", getMarkerPos "mil_dot_camp_10"];
   _mkrZ setMarkerColorLocal "ColorWhite";
   _mkrZ setMarkerShapeLocal "ICON";
   _mkrZ setMarkerTypeLocal "mil_box";
   _mkrZ setMarkerTextLocal "";

};

This for referral:

https://community.bistudio.com/wiki/resistance

https://community.bistudio.com/wiki/Arma_3_Respawn

---------- Post added at 01:25 AM ---------- Previous post was at 01:09 AM ----------

lol, after 10x "preview" and testing with editor il found out that using:

case RESISTANCE: instead of case GUER:

did the trick! no more error :-P

All good now!

Edited by Logitrust

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  

×