Jump to content

MKD3

Member
  • Content Count

    147
  • Joined

  • Last visited

  • Medals

Everything posted by MKD3

  1. Im gonna guess its because youre doing it in description.ext and there is two totally different definitions, mine which are from an addon and use BIS classes, and yours, which redefine everything. It probably boils down to a description.ext UI requiring definition.
  2. Nah, means it isnt configured correctly so even though the code is correct, its not opening. your createdialog code is fine, its the way the UI thats configured that is causing issues
  3. This could be right actually. In which case, cut all of that out, whack it in defines.hpp and include it in description.ext so you dont need to ever look at it again. Ive only really worked on addon UIs, so my example above is that. Hope it helps anyway
  4. It returns true if it successfully opens the dialog. If it fails, it returns false, Ie. the dialog isnt configured or referenced correctly. Which is likely your problem
  5. Yup, all of those classes are BIS created and already exist, you just reference them. Here is an example of a small UI I have made.
  6. All of that crap up the top of your config can be replaced with this class IGUIBack; class RscPicture; class RscFrame; class RscText; class RscEdit; class RscListbox; class RscControlsGroup; class RscCombo; class RscButton; class RscStructuredText; class RscButtonMenu; As to your problem? If it returns false, it means it failed to open a dialog Try formatting your GUI like this class My_Dialog { idd = 10000; name = "My_dialog"; class controls { class MY_BackGround: IGUIBack { idc = 6501; x = 0.355625 * safezoneW + safezoneX; y = 0.39 * safezoneH + safezoneY; w = 0.350625 * safezoneW; h = 0.242 * safezoneH; }; }; }; And calling this createDialog "my_dialog";
  7. You dont need to be using remoteExec if youre doing this locally for a client for one. Here is a BIS example: _act = player addAction ["Exec the file", "somescript.sqf"] If you already know its local, you should be able to rework that for your purposes, including whats above :)
  8. MKD3

    Help with array

    This is locking the script. Its checking the first element and waiting until its dead, not looping through all the elements. //Put whatever you want to stop the loop in here, eg while atleast one unit is alive while { ({alive _x} count ARRAY_UNIT > 0) } do { { if (!alive _x) then {ARRAY_UNIT = ARRAY_UNIT - [_x]}; } foreach ARRAY_UNIT; sleep 1; };
  9. Yeah just putting it out there
  10. ^ youre gonna have a bad time without a sleep in there also.
  11. Why wouldnt you mention it was JIP dependent then? Outline exactly what you want or you wont get the correct answer. //Initplayerlocal.sqf fn_teleport = { if (didJIP) then { player moveincargo unit1}; }; //Wherever you want [] remoteExec ["fn_teleport", allPlayers];
  12. {_x moveincargo unit1} foreach allplayers; Pretty simple one
  13. MKD3

    Addaction Woes

    Yeah, but not in what I provided...
  14. MKD3

    Addaction Woes

    RemoteExec calls the function on all player clients, meaning global commands are not needed. Shouldnt affect anything. Use the code with the hint in it and see if your friend sees it, if he doesn't, then there is a problem. This doesnt require a trigger. Try adding the code to initplayerlocal.sqf, that will ensure its defined on all clients.
  15. MKD3

    Addaction Woes

    _hider and _seeker are passed to the function via the addaction. No need to do anything with naming them. Just tested myself using this code fn_Catch = { params ["_hider", "_seeker"]; if (_hider == player) then {player enablesimulation false;}; hint format ["%1,%2", _hider, _seeker]; }; That will show you who is set as hider and seeker in a hint if you want to see that its working in SP, use it on an AI unit, youll see no result other than a hint. The code I gave will work, but as it requires the _hider to be a player (_hider == player) in this instance, it will only work in MP
  16. MKD3

    Addaction Woes

    Forgot to double the ""; h1 addaction ["Catch!", "[_this select 0, _this select 1] remoteExec [""fn_catch"",allplayers]"]; See if that works
  17. MKD3

    Addaction Woes

    Use this: https://community.bistudio.com/wiki/remoteExec maybe something like: h1 addaction ["Catch!", "[_this select 0, _this select 1] remoteExec ["fn_catch",allplayers];"]; //init.sqf fn_Catch = { params ["_hider", "_seeker"]; if (_hider == player) then {player enablesimulation false;}; };
  18. MKD3

    MP script issues

    Yeah sorry no need to name the units, I was half awake. But you had it sorted, I wouldnt use an isServer check, just run that code in initServer.sqf - Less chance of a mix up, sorry about the half assed initial response lol.
  19. MKD3

    MP script issues

    Problem 1: Unit inits are global, every player that connects and enters will call that code. Use initPlayerLocal.sqf and name your units. Problem 2: try https://community.bistudio.com/wiki/addBackpackCargoGlobal
  20. MKD3

    Custom Music Help

    I use it as a sound config so players who have music turned off hear it. Same thing for music but slightly different configs. Add (in this case) music.ogg to your mission file (copy class music and change it for additional files) //In description.ext class CfgSounds { class music { name = "music"; sound[] = {"music.ogg", db+5, 1}; titles[] = {}; }; }; //Locally on clients player say2d 'Music'; Thats how I do it for intro scenes, basic and works
  21. params ["_unit"]; private ["_selectedUnit"]; _group = group _unit; { _vehicle = vehicle _x; //if vehicle != unit, unit is mounted if ((_unit != _vehicle) && (_unit == gunner _vehicle)) then {_selectedUnit = _x}; } foreach units _group; _selectedUnit; Try that, written here so not tested but should return a unit if it is a gunner.
  22. https://community.bistudio.com/wiki/setVehicleLock This is what I meant. EDIT: LockHelicopter.sqf //Not tested on dedicated Server helicopter1 setVehicleLock "LOCKED"; waituntil { sleep 3; ( {_x distance (getPos Helicopter1) < 10} count allPlayers) > 0; }; helicopter1 setVehicleLock "UNLOCKED";
  23. Lock it and have it unlock when players are within 5 metres of it?
  24. Look into this https://dev.withsix.com/docs/cba/files/ai/fnc_taskPatrol-sqf.html
×