
Untitled
By: a guest on
Jul 1st, 2012 | syntax:
C++ | size: 0.67 KB | hits: 22 | expires: Never
//chaircheck.sqf
sitting = false;
_distToChair = 2;
while {true} do {
waitUntil {!sitting};
_c = nearestObject [player, "FoldChair_with_Cargo"];
if ((player distance _c) < _distToChair && !sitting) then {
if ((_c emptyPositions "cargo")> 0) then {
chairAction = player addaction ["Sit in chair", "sitInChair.sqf",_c];
waituntil {sleep 0.5; (player distance _c) > 4 || sitting;};
player removeAction chairAction;
};
};
sleep 0.2;
};
//sitInChair.sqf
sitting = true;
_c = _this select 3;
if ((_c emptyPositions "cargo")> 0) then {
player moveInCargo _c;
waitUntil {sleep 0.2; ((vehicle player) == player)};
};
sitting = false;