Jump to content

M1ke_SK

Member
  • Content Count

    471
  • Joined

  • Last visited

  • Medals

Everything posted by M1ke_SK

  1. M1ke_SK

    Kill Reward

    You mean something like this?
  2. Sorry for delay. I was away. Will test shortly, Did you tried script without mods ?
  3. Can you wrote dependencies (mods used) ? I dont have all mods you need for mission.
  4. Make sure that barrel is NOT simpleObject and have simulation ENABLED. Can you post your mission so we can have better look?
  5. M1ke_SK

    Spawn ammo caches and marks

    with headless client you can use these if (!hasInterface) then { //run on headless clients and dedicated server }; if (!hasInterface && !isDedicated) then { //run on headless clients only };
  6. M1ke_SK

    Spawn ammo caches and marks

    Make sure you wrap it in if(isServer) { ... } condition, to run it only by server.
  7. M1ke_SK

    Spawn ammo caches and marks

    You dont need loop with mission eventhandler
  8. M1ke_SK

    Spawn ammo caches and marks

    Better use addMissionEventHandler ["EntityKilled", { //your code }]; than looping eveny 10 seconds for every unit on map.
  9. M1ke_SK

    Script - error

    Probably double quotes. Show your init.sqf to be sure. [] execVM "scripts\zlt_fastrope.sqf";
  10. These are controls of display 602
  11. Inside inventory (602) 6331, // uniform 6381, // vest 6191, // backpack 6240 // headgear 610, // Primary Weapon 620, // PW Muzzle 621, // PW Optics 622, // PW Flashlight 611, // secondary weapon 612, // hand Gun 630, // HG Flashlight 628, // HG Muzzle 629 // HG Optics
  12. There is weapon and magazines for weapon in container. player addEventHandler [ "Take", { params ["_unit", "_container", "_item"]; diag_log format ["_item: %1", _item]; } ]; When I take weapon, it shows up in log (_item variable). Problem: With weapon I receive also magazines for this weapon. Question: How to prevent to pick up these additional magazines? Idea: I want to have control of what I can take from container. I want only take weapon without magazines.
  13. Maybe little simplier would be: //clear all magazines player { _unit removeMagazine _x; } forEach magazines _unit; //restore old magazines before take { _unit addMagazine [_x, 1]; } forEach _old_unit_magazines_array; //clear all magazines from container clearMagazineCargoGlobal _container; //restore old magazines before take { _container addMagazineCargoGlobal [_x, 1]; } forEach _old_container_magazines_array;
  14. @pierremgi When you already have some magazines in unit, and you will take weapon witch use these magazines, it will remove them too. _arrayA = [1,2,3,2,4]; _arrayB = [2,3]; _arrayC = _arrayA - _arrayB; _arrayC => [1,4] This will remove all main magazines used by weapon _loaded = MGI_crateLoadout - _new;
  15. Maybe this? { if ( _x in primaryWeaponMagazine _unit ) then { _unit removeMagazine _x } } forEach magazines _unit;
  16. Yes, great. Is there possibility to REMOVE this magazine from weapon? Even when it is empty it should not be in weapon.
  17. I tried it and this only remove bullets from gun. But ammo is in weapon. And it also add magazines to vest for weapon. I will try to fiddle with it.
  18. I am thinking if should I check items of unit before eventHandler and compare it with items after take, but that seems like overkill.
  19. I have code where I crate dialog via script. I set action to close dialog for button _ctrl_button_close. disableSerialization; _ctrl_background = (findDisplay 46) ctrlCreate ["RscPicture", -1]; _ctrl_background ctrlSetPosition [0.438124 * safezoneW + safezoneX, 0.445 * safezoneH + safezoneY, 0.12375 * safezoneW, 0.11 * safezoneH]; _ctrl_background ctrlSetText "#(rgb,8,8,3)color(0,0,0,0.5)"; _ctrl_background ctrlCommit 0; _ctrl_button_give = (findDisplay 46) ctrlCreate ["RscButton", -1]; _ctrl_button_give ctrlSetPosition [0.469062 * safezoneW + safezoneX, 0.511 * safezoneH + safezoneY, 0.061875 * safezoneW, 0.022 * safezoneH]; _ctrl_button_give ctrlSetText "GIVE"; _ctrl_button_give ctrlCommit 0; _ctrl_button_close = (findDisplay 46) ctrlCreate ["RscButton", -1]; _ctrl_button_close ctrlSetPosition [0.551562 * safezoneW + safezoneX, 0.445 * safezoneH + safezoneY, 0.0103125 * safezoneW, 0.022 * safezoneH]; _ctrl_button_close ctrlSetText "X"; _ctrl_button_close buttonSetAction "closeDialog 0"; _ctrl_button_close ctrlCommit 0; _ctrl_edit = (findDisplay 46) ctrlCreate ["RscEdit", -1]; _ctrl_edit ctrlSetPosition [0.45875 * safezoneW + safezoneX, 0.467 * safezoneH + safezoneY, 0.0825 * safezoneW, 0.022 * safezoneH]; _ctrl_edit setText "0"; _ctrl_edit ctrlCommit 0; Problem: Can't close dialog with ESC key or close button (x). Question: How to close dialog created with script?
  20. I am familiar with creating dialogs in description.ext. But I am wondering if there is way to create dialog without defining it in description.
  21. Is there a way to create dialog via script? How to use that ? createDialog "MyCustomDialog";
  22. so I set IDCs for controls and added displayEventHandler But I cannot enter value into RscEdit or interact with dialog. disableSerialization; _ctrl_background = (findDisplay 46) ctrlCreate ["RscPicture", 7001]; _ctrl_background ctrlSetPosition [0.438124 * safezoneW + safezoneX, 0.445 * safezoneH + safezoneY, 0.12375 * safezoneW, 0.11 * safezoneH]; _ctrl_background ctrlSetText "#(rgb,8,8,3)color(0,0,0,0.5)"; _ctrl_background ctrlCommit 0; _ctrl_button_give = (findDisplay 46) ctrlCreate ["RscButton", 7002]; _ctrl_button_give ctrlSetPosition [0.469062 * safezoneW + safezoneX, 0.511 * safezoneH + safezoneY, 0.061875 * safezoneW, 0.022 * safezoneH]; _ctrl_button_give ctrlSetText "GIVE"; _ctrl_button_give ctrlCommit 0; _ctrl_button_close = (findDisplay 46) ctrlCreate ["RscButton", 7003]; _ctrl_button_close ctrlSetPosition [0.551562 * safezoneW + safezoneX, 0.445 * safezoneH + safezoneY, 0.0103125 * safezoneW, 0.022 * safezoneH]; _ctrl_button_close ctrlSetText "X"; _ctrl_button_close buttonSetAction "{ ctrlDelete ( (findDisplay 46) displayCtrl _x ); } forEach [7001, 7002, 7003, 7004];"; //_ctrl_button_close buttonSetAction "closeDialog 0"; _ctrl_button_close ctrlCommit 0; _ctrl_edit = (findDisplay 46) ctrlCreate ["RscEdit", 7004]; _ctrl_edit ctrlSetPosition [0.45875 * safezoneW + safezoneX, 0.467 * safezoneH + safezoneY, 0.0825 * safezoneW, 0.022 * safezoneH]; _ctrl_edit ctrlSetText "0"; _ctrl_edit ctrlCommit 0; my_custom_display_event_handler = (findDisplay 46) displayAddEventHandler [ "KeyDown", { params ["_ctrl", "_dikCode", "_shift", "_ctrlKey", "_alt"]; if (_dikCode == 1 && !_shift && !_ctrlKey && !_alt) then { { ctrlDelete ( (findDisplay 46) displayCtrl _x ); } forEach [7001, 7002, 7003, 7004]; }; (findDisplay 46) displayRemoveEventHandler ["KeyDown", my_custom_display_event_handler]; } ];
  23. There is set action for button _ctrl_button_close buttonSetAction "closeDialog 0"; But I cannot click on button or close it with ESC key.
×