Rook Mk1 46 Posted April 30, 2021 Basically I need a colour variable to be passed through to a subtitle header. //Select HEX colour from given string private _colourHTML = switch (toUpper _colour) do { case "SIDE": {"#00ccff"}; case "GLOBAL": {"#d7d7d9"}; case "VEHICLE": {"#fbd40b"}; case "COMMAND": {"#e5e760"}; case "GROUP": {"#beee7e"}; case "DIRECT": {"#fffffb"}; case "CUSTOM": {"#ec5a29"}; case "SYSTEM": {"#8a8a88"}; case "BLUFOR": {([WEST,false] call BIS_fnc_sideColor) call BIS_fnc_colorRGBtoHTML}; case "OPFOR": {([EAST,false] call BIS_fnc_sideColor) call BIS_fnc_colorRGBtoHTML}; case "GUER": {([INDEPENDENT,false] call BIS_fnc_sideColor) call BIS_fnc_colorRGBtoHTML}; case "CIV": {([CIVILIAN,false] call BIS_fnc_sideColor) call BIS_fnc_colorRGBtoHTML}; }; // Show subtitle _text = parseText format [ if (_from == "") then { "<t align='center' shadow='2' size='%3' font='RobotoCondensedBold'>%2</t>" } else { if (_from == "#sfx") then { "<t align='center' shadow='2' size='%3' font='RobotoCondensedBold'>*%2*</t>" } else { "<t align='center' shadow='2' size='%3' font='RobotoCondensedBold'><t color='%4'>%1:<t color='#ffffff'><br />%2</t>" } }, toupper _from, _text, (safezoneH * 0.65) max 1, _colorHTML ]; I just get Error Undefined variable in expression: _colorHTML It works if I put something like _colorHTML = "#00ccff"; before the subtitles part though. Any idea why? Share this post Link to post Share on other sites
gc8 981 Posted April 30, 2021 Looks like a typo "_colourHTML" --- "_colorHTML" 1 Share this post Link to post Share on other sites
Rook Mk1 46 Posted April 30, 2021 Oh god, getting my regional spelling mixed in. Thanks for catching that. Share this post Link to post Share on other sites