Jump to content

Duffman_DK

Member
  • Content Count

    2
  • Joined

  • Last visited

  • Medals

Everything posted by Duffman_DK

  1. Cannot seem to get this while loop to repeat the code with these 2 if conditions. It stops after the first sleep, and does not loop to check the if conditions. What am I missing? phoneringing = false; phonehascalled = 0; addactionphone = false; phonepickedup = false; while { phoneringing } do { Playsound ["Orange_PhoneCall_Ringtone", true]; phonehascalled = phonehascalled +1; sleep 1; if (Player2 inArea homedesk) && (!addactionphone) then { [deskphonehome, ["Tag telefonen", { phoneringing = false; phonepickedup = true; ["pickupphone","SUCCEEDED"] call BIS_fnc_taskSetState; (_this select 0) removeaction (_this select 2)}]]remoteExec ["addAction"]; addactionphone = true; } else { sleep 1; if (phonehascalled > 30) then { phoneringing = false; [ ["I nåede ikke at tage telefonen"],safeZoneX, safeZoneH / 2,true,"<t font='PuristaBold'>%1</t>",[],{ false },true ] spawn BIS_fnc_typeText2; ["pickupphone","FAILED"] call BIS_fnc_taskSetState; ["endm3", false, 10] call BIS_fnc_endMission; } else {}; }; }; waituntil {phonepickedup};
  2. beno83_au thx a lot for the link to the debugging , will definitely check that out. Ahh yes sorry, forgot the include the first part of the code that sets the phoneringing variable to true .. Great, thx a lot, will test it when I get a chance :)
×