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};