Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Schatten

Member
  • Content Count

    816
  • Joined

  • Last visited

  • Medals

Everything posted by Schatten

  1. @twistking, use select command.
  2. Schatten

    Problem with getVariable

    Maybe, it depends on what you want.
  3. Schatten

    Problem with getVariable

    You can use either database or profile namespace (profileNamespace, missionProfileNamespace).
  4. Schatten

    Problem with getVariable

    Your code work's fine for me, but returns empty string, because the last line returns it (_text remoteExec ['systemChat',-2,FALSE];). It also won't systemChat of player's rankRating, because systemChat will be executed on each client, but not the server (in singleplayer or hosted game admin's computer is server).
  5. @DMFalke, configs in SQF files won't work. You should include notifications.sqf (BTW, I recommend to change extension to cpp) into Description.ext.
  6. @DMFalke, publish a code where CfgNotifications class is included.
  7. Schatten

    Problem with getVariable

    Where this code is placed?
  8. Schatten

    Problem with getVariable

    @Vadym Mazur, you use wrong syntax of getVariable command.
  9. Schatten

    Problem with getVariable

    @Vadym Mazur, you set rankRating variable in mission namespace, but get it's value from unit's namespace. Set value in unit's namespace, and, if it's multiplayer mission, make it public.
  10. Schatten

    Marker Names

    Good luck! By the way, you don't have to use preprocessor commands: private ["_captureMarker1", "_captureMarker2"]; for "_n" from 1 to 19 do { _captureMarker1 = format ["capture_%1", _n]; _captureMarker2 = format ["capture_%1", _n + 1]; ... };
  11. Schatten

    Marker Names

    You can use for-loop: #define CAPTURE_MARKER_FORMAT "capture_%1" private ["_captureMarker1", "_captureMarker2"]; for "_n" from 1 to 19 do { _captureMarker1 = format [CAPTURE_FORMAT_MARKER, _n]; _captureMarker2 = format [CAPTURE_FORMAT_MARKER, _n + 1]; ... };
  12. Schatten

    Delay to unit when drop plane

    @Casio91Fin, spawn your code as a new script, where using suspensions is allowed.
  13. Schatten

    Position

    @Stormmy1950, I fixed the problem, also I rewrote your code: addMissionEventHandler ["Draw3D", { if (!isGameFocused) exitWith { }; if (!((((vehicle player) isKindOf "Air") || { _control = UAVControl (getConnectedUAV player); ((_control find player) + 1) == (_control find "GUNNER") }) && { cameraView == "Gunner" })) exitWith { }; _zoomLevel = round ((([0.5, 0.5] distance2D (worldToScreen (positionCameraToWorld [0, 3, 4]))) * (getResolution select 5) / 2) * 10) / 10; _offsets = switch (true) do { case (_zoomLevel <= 0.5): { [ [[0, 1, 0], [0, 0.5, 0]], [[0, -1, 0], [0, -0.5, 0]], [[1, 0, 0], [0.5, 0, 0]], [[-1, 0, 0], [-0.5, 0, 0]] ] }; case ((_zoomLevel > 0.5) && { _zoomLevel <= 3 }): { [ [[0, 0.25, 0], [0, 0.12, 0]], [[0, -0.25, 0], [0, -0.12, 0]], [[0.25, 0, 0], [0.12, 0, 0]], [[-0.25, 0, 0], [-0.12, 0, 0]] ] }; case (_zoomLevel > 3): { [ [[0, 0.06, 0], [0, 0.03, 0]], [[0, -0.06, 0], [0, -0.03, 0]], [[0.06, 0, 0], [0.03, 0, 0]], [[-0.06, 0, 0], [-0.03, 0, 0]] ] }; default { [] }; }; if ((count _offsets) == 0) exitWith { }; _drawIcon3DArgs = [ "", [], [], 0, 0, 0, "", 2, 0.05, "PuristaMedium" ]; _center = AGLToASL (positionCameraToWorld [0, 0, 3]); { _letter = _x select 0; _color = _x select 1; _offsetsPair = _offsets select _forEachIndex; _drawIcon3DArgs set [1, _color]; _drawIcon3DArgs set [2, ASLToAGL (_center vectorAdd (_offsetsPair select 0))]; _drawIcon3DArgs set [6, _letter]; drawIcon3D _drawIcon3DArgs; _drawIcon3DArgs set [2, ASLToAGL (_center vectorAdd (_offsetsPair select 1))]; _drawIcon3DArgs set [6, "."]; drawIcon3D _drawIcon3DArgs; } forEach [ ["N", [1, 0.1, 0.1, 1]], ["S", [1, 1, 1, 0.7]], ["E", [1, 1, 1, 0.7]], ["W", [1, 1, 1, 0.7]] ]; }];
  14. This is because PlayerConnected event, where player's loadout, position and direction are restored, occurs when a player connects to a server, not joins a mission. As a workaround, reconnect to the server. Or try this patch: if (isServer) then { TAG_fnc_loadClientData = compileFinal ((str { params [ ["_client", objNull, [objNull]] ]; if (isNull _client) exitWith { }; private _clientData = profileNamespace getVariable ["TAG_disconnectedLoadouts", createHashMap]; private _clientDatum = _clientData getOrDefault [getPlayerUID _client, []]; if (_clientDatum isEqualTo []) exitWith { }; _clientDatum remoteExecCall ["TAG_fnc_applyClientData", _client]; }) trim ["{}", 0]); }; if (!isDedicated) then { TAG_fnc_applyClientData = compileFinal ((str { params [ ["_loadout", [], [[]]], ["_position", [], [[]], [2, 3]], ["_direction", 0, [0]] ]; if ((_loadout isEqualTo []) or { _position isEqualTo [] }) exitWith { false }; player setUnitLoadout _loadout; player setDir _direction; player setPos _position; true }) trim ["{}", 0]); waitUntil { !(isNull player) }; [player] remoteExecCall ["TAG_fnc_loadClientData", 2]; };
  15. Schatten

    need help

    @topden, here seems to be a suitable example for weapon holder removal. To block getting weapons, you need to handle InventoryClosed event, where, for example, to assign the player's GUID to the weapon holder, and InventoryClosed event, where to check this GUID and, if it is equal to the player's GUID, close the inventory. Plus, you need to add using inGameUISetEventHandler command Rearm event handler, where also check the GUID.
  16. Hey! I have an issue related to ListBox multiple item selection. I've set style property of my list box: style = LB_TEXTURES + LB_MULTI; To use these constants I've included this file: #include "\a3\3den\UI\resincl.inc" Despite that I can't select multiple items with either Shift or Ctrl. Another issue is that if the first item is selected, lbSelection command returns an empty array. This is probably a bug. Can anyone check these issues on their PCs?
  17. I assumed that if to deselect all list box items in regular list box you should use _control lbSetCurSel -1; then to do the same for LB_MULTI list box, you should use lbSetSelected with appropriate changes.
  18. Sure. I have such dialog: and want to delete list box items and deselect all of them after unloading cargo items. According to BIKI: My list box has LB_MULTI style, so let's use lbSetSelected: private _netIds = (lbSelection _control) apply { _control lbData _x }; { for "_i" from 0 to ((lbSize _control) - 1) do { if ((_control lbData _i) == _x) exitWith { _control lbDelete _i; }; }; } forEach _netIds; _control lbSetSelected [-1, true]; The result is here: Now let's see the result of using lbSetCurSel:
  19. Also, despite BIKI, you can't use lbSetSelected command to deselect all items in LB_MULTI list box -- I had to use lbSetCurSel instead. So either BIKI has wrong info or lbSetSelected is bugged.
  20. Thanks, @Larrow! The problem was that I was updating the list box content in a loop. I've moved the list box populating code outside of the loop and now everything works fine, both multi selection and lbSelection command.
  21. @Joe98, you can simplify code: private _scriptName = selectRandom ["script1", "script2", "script3", "script4", "script5"]; execVM (format ["%1.sqf", _scriptName]); It depends what you want.
  22. Schatten

    Help with array.

    @Robustcolor, if you don't need main marker names, then you can simplify the code: _markers = [["m1_1", "m1_2"], ["m2_1", "m2_2"]]; _subTarget = selectRandom (selectRandom _markers); If you need main marker names, then you can use either this code: _markers = [["1", ["m1_1", "m1_2"]], ["2", ["m2_1", "m2_2"]]]; _subTarget = selectRandom ((selectRandom _markers) select 1); or this one: _markersHashMap = createHashMap [["1", ["m1_1", "m1_2"]], ["2", ["m2_1", "m2_2"]]]; _subTarget = selectRandom (_markersHashMap get (selectRandom (keys _markersHashMap)));
  23. Schatten

    hint with linebreak/column

    No. To do this you need to use @7erra's code and structured text.
  24. Schatten

    hint with linebreak/column

    @Harzach, I've got this: https://imgur.com/a/T24LrmE
×