Split compiles a bit, diff sell ranges for Vehicles, air-vehicles and boats

This commit is contained in:
Skaronator
2013-11-08 21:11:26 +01:00
parent 36782396b8
commit 2d0025608f
27 changed files with 234 additions and 140 deletions

View File

@@ -0,0 +1,131 @@
private ["_dikCode", "_handled"];
_dikCode = _this select 1;
_handled = false;
if (_dikCode in[0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
_handled = true;
};
if (_dikCode in actionKeys "MoveForward") exitWith {r_interrupt = true};
if (_dikCode in actionKeys "MoveLeft") exitWith {r_interrupt = true};
if (_dikCode in actionKeys "MoveRight") exitWith {r_interrupt = true};
if (_dikCode in actionKeys "MoveBack") exitWith {r_interrupt = true};
//Prevent exploit of drag body
if ((_dikCode in actionKeys "Prone") and r_drag_sqf) exitWith { force_dropBody = true; };
if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) exitWith { force_dropBody = true; };
_shift = _this select 2;
_ctrl = _this select 3;
_alt = _this select 4;
//diag_log format["Keypress: %1", _this];
if (_dikCode in (actionKeys "GetOver")) then {
if (player isKindOf "PZombie_VB") then {
_handled = true;
DZE_PZATTACK = true;
} else {
_nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8];
if (count _nearbyObjects > 0) then {
if((diag_tickTime - dayz_lastCheckBit > 4)) then {
[objNull, player, rSwitchMove,"GetOver"] call RE;
player playActionNow "GetOver";
dayz_lastCheckBit = diag_tickTime;
} else {
_handled = true;
};
};
};
};
//if (_dikCode == 57) then {_handled = true}; // space
//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
if (_dikCode == 210) then {
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
if (_dikCode in actionKeys "PushToTalk" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "VoiceOverNet" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "PushToTalkDirect" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "Chat" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "User20" and (diag_tickTime - dayz_lastCheckBit > 5)) then {
dayz_lastCheckBit = diag_tickTime;
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
// numpad 8 0x48 now pgup 0xC9 1
if ((_dikCode == 0xC9 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User15")) then {
DZE_Q = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User16")) then {
DZE_Z = true;
};
// numpad 8 0x48 now pgup 0xC9 0.1
if ((_dikCode == 0xC9 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User13")) then {
DZE_Q_alt = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User14")) then {
DZE_Z_alt = true;
};
// numpad 8 0x48 now pgup 0xC9 0.01
if ((_dikCode == 0xC9 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User7")) then {
DZE_Q_ctrl = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User8")) then {
DZE_Z_ctrl = true;
};
// numpad 4 0x4B now Q 0x10
if (_dikCode == 0x10 or (_dikCode in actionKeys "User17")) then {
DZE_4 = true;
};
// numpad 6 0x4D now E 0x12
if (_dikCode == 0x12 or (_dikCode in actionKeys "User18")) then {
DZE_6 = true;
};
// numpad 5 0x4C now space 0x39
if (_dikCode == 0x39 or (_dikCode in actionKeys "User19")) then {
DZE_5 = true;
};
// esc
if (_dikCode == 0x01) then {
DZE_cancelBuilding = true;
};
if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
call dayz_forceSave;
};
/*
if (_dikCode in actionKeys "IngamePause") then {
_idOnPause = [] spawn dayz_onPause;
};
*/
_handled

View File

@@ -74,7 +74,7 @@ if (_qty >= _qty_in) then {
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
_qty = count _obj;
};

View File

@@ -24,7 +24,7 @@ _bos = 0;
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_boat];
_qty = count _obj;
_bos = 1;
};

View File

@@ -74,8 +74,12 @@ if (_qty >= _qty_in) then {
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
_qty = count _obj;
if (_part_in isKindOf "AIR") then {
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_air];
} else {
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
};
_qty = count _obj;
};
if (_qty >= _qty_in) then {

View File

@@ -23,6 +23,7 @@ if (!isDedicated) then {
building_spawnLoot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf";
// player_taskHint = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_taskHint.sqf";
building_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";
dayz_spaceInterrupt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\dayz_spaceInterrupt.sqf";
//animal_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\animal_monitor.sqf";
// building_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\building_monitor.sqf";
player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; //Runs when player fires. Alerts nearby Zeds depending on calibre and audial rating
@@ -267,141 +268,7 @@ if (!isDedicated) then {
} forEach _this;
_counter
};
dayz_spaceInterrupt = {
private ["_dikCode", "_handled"];
_dikCode = _this select 1;
_handled = false;
if (_dikCode in[0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
_handled = true;
};
if (_dikCode in actionKeys "MoveForward") exitWith {r_interrupt = true};
if (_dikCode in actionKeys "MoveLeft") exitWith {r_interrupt = true};
if (_dikCode in actionKeys "MoveRight") exitWith {r_interrupt = true};
if (_dikCode in actionKeys "MoveBack") exitWith {r_interrupt = true};
//Prevent exploit of drag body
if ((_dikCode in actionKeys "Prone") and r_drag_sqf) exitWith { force_dropBody = true; };
if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) exitWith { force_dropBody = true; };
_shift = _this select 2;
_ctrl = _this select 3;
_alt = _this select 4;
//diag_log format["Keypress: %1", _this];
if (_dikCode in (actionKeys "GetOver")) then {
if (player isKindOf "PZombie_VB") then {
_handled = true;
DZE_PZATTACK = true;
} else {
_nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8];
if (count _nearbyObjects > 0) then {
if((diag_tickTime - dayz_lastCheckBit > 4)) then {
[objNull, player, rSwitchMove,"GetOver"] call RE;
player playActionNow "GetOver";
dayz_lastCheckBit = diag_tickTime;
} else {
_handled = true;
};
};
};
};
//if (_dikCode == 57) then {_handled = true}; // space
//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
if (_dikCode == 210) then {
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
if (_dikCode in actionKeys "PushToTalk" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "VoiceOverNet" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "PushToTalkDirect" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "Chat" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "User20" and (diag_tickTime - dayz_lastCheckBit > 5)) then {
dayz_lastCheckBit = diag_tickTime;
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
// numpad 8 0x48 now pgup 0xC9 1
if ((_dikCode == 0xC9 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User15")) then {
DZE_Q = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User16")) then {
DZE_Z = true;
};
// numpad 8 0x48 now pgup 0xC9 0.1
if ((_dikCode == 0xC9 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User13")) then {
DZE_Q_alt = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User14")) then {
DZE_Z_alt = true;
};
// numpad 8 0x48 now pgup 0xC9 0.01
if ((_dikCode == 0xC9 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User7")) then {
DZE_Q_ctrl = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User8")) then {
DZE_Z_ctrl = true;
};
// numpad 4 0x4B now Q 0x10
if (_dikCode == 0x10 or (_dikCode in actionKeys "User17")) then {
DZE_4 = true;
};
// numpad 6 0x4D now E 0x12
if (_dikCode == 0x12 or (_dikCode in actionKeys "User18")) then {
DZE_6 = true;
};
// numpad 5 0x4C now space 0x39
if (_dikCode == 0x39 or (_dikCode in actionKeys "User19")) then {
DZE_5 = true;
};
// esc
if (_dikCode == 0x01) then {
DZE_cancelBuilding = true;
};
if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
call dayz_forceSave;
};
/*
if (_dikCode in actionKeys "IngamePause") then {
_idOnPause = [] spawn dayz_onPause;
};
*/
_handled
};
player_setDate = {
private ["_setdatebool"];
_setdatebool = false;

View File

@@ -421,9 +421,17 @@ if(isNil "DZE_TRADER_SPAWNMODE") then {
if(isNil "dayz_tameDogs") then {
dayz_tameDogs = false;
};
if(isNil "dayz_sellDistance") then {
dayz_sellDistance = 20;
if(isNil "dayz_sellDistance_vehicle") then {
dayz_sellDistance_vehicle = 10;
};
if(isNil "dayz_sellDistance_boat") then {
dayz_sellDistance_boat = 30;
};
if(isNil "dayz_sellDistance_air") then {
dayz_sellDistance_air = 40;
};
if(isNil "dayz_paraSpawn") then {
dayz_paraSpawn = false;
};

View File

@@ -33,6 +33,10 @@ dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0
DynamicVehicleDamageHigh = 100; // Default: 100
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
EpochEvents = [["any","any","any","any",30,"crash_spawner"],["any","any","any","any",0,"crash_spawner"],["any","any","any","any",15,"supply_drop"]];
dayz_fullMoonNights = true;

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 30; // Default = 30
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -33,6 +33,10 @@ dayz_fullMoonNights = true;
dayz_minpos = -26000;
dayz_maxpos = 26000;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_paraSpawn = false;
dayz_maxAnimals = 8; // Default: 8

View File

@@ -31,6 +31,10 @@ dayz_fullMoonNights = true;
// new stuff
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_MapArea = 12000; // Default = 10000
// new stuff
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 30; // Default = 30
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -27,6 +27,10 @@ dayz_MapArea = 7000; // Default = 10000
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -27,6 +27,10 @@ dayz_MapArea = 6000; // Default = 10000
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -27,6 +27,10 @@ dayz_MapArea = 6000; // Default = 10000
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 30; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0

View File

@@ -28,6 +28,10 @@ dayz_maxLocalZombies = 40; // Default = 40
dayz_paraSpawn = false;
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0