Jump to content

MKD3

Member
  • Content Count

    147
  • Joined

  • Last visited

  • Medals

Everything posted by MKD3

  1. MKD3

    addVehicle from list

    put the 2nd code back into an SQF and put this at the top, will stop that error waituntil {sleep 3;(!isnil "vehList")};
  2. You can return it through using this things = getAllHitPointsDamage car1 and in one of the watch lists, type things. Returns the array of hitpoints which youll have to sift through
  3. Id use this to get all of the available damage points https://community.bistudio.com/wiki/getAllHitPointsDamage Then use this to specifically break the headlights, probably the only way https://community.bistudio.com/wiki/setHitPointDamage
  4. MKD3

    Addaction Teleport

    How are you executing it? or post your code, it doesnt require anything other than the player in question being the unit called mosstone
  5. MKD3

    Addaction Teleport

    Sorry I mightve gotten confused, it may need to be in initplayerLocal.sqf if (player == mosstone) then {player addEventHandler ["respawn", {player addAction ["Teleport", {player execVM "teleport.sqf"}]; } ];};
  6. class GTP_DiagLRM { idd = -1; name = "GTP_DialogLRM"; class controls { class GTP_LRM_Background: IGUIBack { idc = 85701; x = "0.340259 * safezoneW + safezoneX"; y = "0.379 * safezoneH + safezoneY"; w = "0.309375 * safezoneW"; h = "0.297 * safezoneH"; colorBackground[] = {0,0,0.5,0.5}; }; class GTP_LRM_Border: RscFrame { idc = 85702; text = "GTP v4"; x = "0.345312 * safezoneW + safezoneX"; y = "0.379 * safezoneH + safezoneY"; w = "0.299062 * safezoneW"; h = "0.286 * safezoneH"; sizeEx = 0.035; colorBackground[] = {0,0,0.1,0}; }; class GTP_LRM_TeleportButton: RscButton { idc = 85703; action = "[] spawn MKD3_fnc_GTPTeleport;"; text = "Teleport"; x = "0.5825 * safezoneW + safezoneX"; y = "0.478 * safezoneH + safezoneY"; w = "0.0567187 * safezoneW"; h = "0.066 * safezoneH"; colorText[] = {0,1,0,1}; colorBackground[] = {0.2,0.2,0.2,1}; colorActive[] = {1,1,1,0.2}; }; class GTP_LRM_WaitButton: RscButton { idc = 85704; action = "[] spawn MKD3_fnc_GTPWait;"; text = "Wait"; x = "0.5825 * safezoneW + safezoneX"; y = "0.566 * safezoneH + safezoneY"; w = "0.0567187 * safezoneW"; h = "0.066 * safezoneH"; colorText[] = {0.7,0.5,0.2,1}; colorBackground[] = {0.2,0.2,0.2,1}; colorActive[] = {1,1,1,0.2}; }; class GTP_LRM_YourSquadTextBox: RscText { idc = 85705; colourtext[] = {0,0.7,0.5,1}; text = "LRM MODE"; x = "0.350469 * safezoneW + safezoneX"; y = "0.412 * safezoneH + safezoneY"; w = "0.103125 * safezoneW"; h = "0.022 * safezoneH"; colorText[] = {0,1,0,1}; }; class GTP_LRM_ListBox: RscListBox { idc = 85706; x = "0.350469 * safezoneW + safezoneX"; y = "0.467 * safezoneH + safezoneY"; w = "0.221719 * safezoneW"; h = "0.187 * safezoneH"; colorBackground[] = {0,0,0,0.7}; }; class GTP_LRM_AvailableBasesTextBox: RscText { idc = 85707; text = "Available Bases:"; x = "0.350469 * safezoneW + safezoneX"; y = "0.445 * safezoneH + safezoneY"; w = "0.0783436 * safezoneW"; h = "0.022 * safezoneH"; }; class GTP_LRM_ModeButton: RscButton { idc = 85708; action = "["lrm"] spawn MKD3_fnc_GTPSwitchMode"; text = "Switch Mode"; x = "0.5825 * safezoneW + safezoneX"; y = "0.401 * safezoneH + safezoneY"; w = "0.0567187 * safezoneW"; h = "0.033 * safezoneH"; colorText[] = {1,0,0,1}; colorBackground[] = {0.2,0.2,0.2,1}; colorActive[] = {1,1,1,0.2}; }; }; }; This is what I use, Id recommend not using GUI grid as it is a mess, when you have the GUI looking the way you want, right click on EVERY control in it and change them to safezone sizing, if sizing is wrong it means the control may not be displayed.
  7. MKD3

    Addaction Teleport

    This will give the player an action again when he has respawned. Use it in init.sqf Mosstone addEventHandler ["respawn", {Mosstone addAction ["Teleport", {player execVM "teleport.sqf"}]; } ];
  8. Its pretty simple stuff, everyone here seems a bit confused. If (true) then {}; will do stuff... if (false) then {}; will not. So as long as you have defined a variable and it is true, then that syntax will work and do stuff. Your syntax is not wrong, something else is. Id turn on script errors and youll see what is wrong. In the mean time. ​_variable = 1; if (_variable == 1) then {hint '_variable is 1';} else {hint '_variable is not 1';}; Play with that and see what you can make of it. You should understand the syntax and how triggers work before trying to over complicate anything. Hope this helped
  9. Ohhh right in the middle lol, Ok nevermind
  10. Remember to add a sleep to the start of that waituntil otherwise that code is gonna run as often as possible and hog resources. Eg: waituntil {sleep 10; systemchat format ....yada yada}; Edit: Blind
  11. I wouldnt recommend doing what has been suggested, having a waituntil without a sleep in it running on server is gonna suck juice. //Find Last Alive player group _groups = []; _loop = true; { if (_x == leader group _x) then {_groups pushback group _x}; } foreach allplayers; while {_loop} do { { if (count units _x == 0) then {_groups = groups - [_x]}; } foreach _groups; if ((count _groups) == 1) then {_loop = false;}; sleep 10; }; last_group = _groups select 0; last_group; Edit: Wrote this before you guys continued so this mightve already been solved.
  12. Not enough info here, do you want all vehicles on a side? in an area?
  13. Hi all, More of a 'has anyone seen this' question. I wrote a script for some ambient artillery that works fine in 3den, locally in the SP and MP editor, However once I run it on our dedicated server, it runs the script and the artillery pieces dont adjust their aim as they do locally. Anyone had issues with doWatch or have a work around? Ive tried all localities and doTarget, commandWatch, commandTarget. Out of ideas. Any help is appreciated Arty.sqf _artilleryArray = _debugobjects;//Or an array of any artillery objects _position = getpos (_artilleryArray select 0); _aim = createVehicle ["DummyTarget",[((_position select 0) + 2500), ((_position select 1)),0],[],0,"NONE"]; //Make battery aim and prepare { _artillery = _x; _artillery addmagazine (getartilleryammo [_x] select 0 ); //XYZ fake target, makes the barrels move around but adjusting () + X; _posX = (_position select 0) + 400; _posY = (_position select 0) + 2700; _posZ = (_position select 0) + 100; _fakeaim = [_posX,_posY,_posZ]; _artillery dowatch _fakeaim; _deleteShot = _x addEventHandler ["Fired",{(_this select 6);deleteVehicle (_this select 6)}]; } foreach _artilleryArray; sleep 7; _cantfire = _artilleryArray select 0; //Loop to make artillery fire randomly, adjust X in (X * (count _artilleryArray)) to change number of times entire battery will fire once for "_1" from 1 to (5 * (count _artilleryArray)) do { sleep random 1.5; _fire = selectrandom _artilleryArray; if (_fire == _cantfire) then { _fire = selectrandom _artilleryArray; }; _fire fireattarget [_aim]; _Cantfire = _fire; }; { _x removealleventhandlers "Fired"; } foreach _artilleryArray;
  14. You literally have answered your own question. Next time run that through debug before running it through the forums :)
  15. MKD3

    Dialogs issue

    I havent done this in a fair few months but it looks like you also havent included your defines.hpp in the dialog.hpp. If anyone knows more then correct me but I would have this... ie: #include <defines.hpp> class gunShop_dialog { yada yada
  16. Ah, I thought it was for the post above his, fair enough
  17. Im confused, you literally changed nothing to his code, just made it prettier.
  18. This is old shizz yo, wont work, if you want an addaction use this: player addAction [ "Eject", {player allowdamage false; player action ["Eject", vehicle player]; sleep 1; player allowdamage true; } ]; or use this to force it player allowdamage false; player action ["Eject", vehicle player]; sleep 1; player allowdamage true; Ive never used SQS for anything so I guess it isn't necessary, SQF is the norm. Not tested, so let me know if it doesnt work and Ill actually test it
  19. Not to mention, what if someone runs say, a loop thats meant only for the server, globally. Without a locality check it could cause fuckery
  20. {if (vehicle _x == _x) then {_x moveincargo vehicle leader _grp1}} foreach units _grp1; Give that a try
  21. MKD3

    skipTime causing explosions...?

    Why not just setDate? Or try: {_x enablesimulation false; _x allowdamage false;} foreach crew Car1
  22. Cheers bro, I vaguely tried getting the arty to constantly aim and gave up, so youve saved me some time in the future lol
  23. When I create intros i always use say2d for music and set the volume in description.ext
  24. MKD3

    EnableSimulation

    In init.sqf or a trigger
×