Lock/unlock vehicle optimizations

This commit is contained in:
vbawol
2013-06-19 10:07:32 -05:00
parent 96334cdeba
commit 005497be43
2 changed files with 26 additions and 16 deletions

View File

@@ -5,13 +5,16 @@ if(TradeInprogress) exitWith { cutText ["Lock vehicle already in progress." , "P
TradeInprogress = true;
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = 1;
dayzLockVehicle = [_vehicle,true];
if(player distance _vehicle < 10) then {
if (local _vehicle) then {
dayzLockVehicle spawn local_lockUnlock
} else {
publicVariable "dayzLockVehicle";
};
};
s_player_lockUnlock_crtl = -1;
_vehicle setVehicleInit "this lock true; this lockCargo true;";
processInitCommands;
//_vehicle lock true;
//dayzLockVehicle = [_vehicle,true];
//publicVariable "dayzLockVehicle";
TradeInprogress = false;

View File

@@ -1,13 +1,20 @@
private["_vehicle"];
_vehicle = _this select 3;
if(TradeInprogress) exitWith { cutText ["Lock vehicle already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = 1;
dayzLockVehicle = [_vehicle,false];
if(player distance _vehicle < 10) then {
if (local _vehicle) then {
dayzLockVehicle spawn local_lockUnlock
} else {
publicVariable "dayzLockVehicle";
};
};
s_player_lockUnlock_crtl = -1;
_vehicle setVehicleInit "this lock false; this lockCargo false;";
processInitCommands;
// Wiki states that lock is globally brodcast but the variable has to be local
//_vehicle lock false;
//dayzLockVehicle = [_vehicle,false];
//publicVariable "dayzLockVehicle";
TradeInprogress = false;