Do not send purchased vehicle marker arrow over network

Only the player buying the vehicle needs to see the arrow.

Also fixed CfgMagazines error from:
2c4c75c67c (diff-fcf3df9a25b3d05402ab4e4809673194R6)
@icomrade
This commit is contained in:
ebaydayz
2016-08-09 14:52:15 -04:00
parent 1ed78cc085
commit c62e3147c8
12 changed files with 69 additions and 66 deletions

View File

@@ -3,7 +3,7 @@
#define COMBINE_MAG class CombineMag\
{\
text = $STR_MAG_COMBINE;\
script = "spawn player_combineMag;"; // r_action_count = r_action_count + 1;\
script = "spawn player_combineMag;";\
};
#include "9x18.hpp" //Makarov

View File

@@ -146,15 +146,16 @@ if (_enoughMoney) then {
_location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
};
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_location = ([_veh] call FNC_GetPos);
_sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location;
_location = [_sign] call FNC_GetPos;
if (_buyingType in ["trade_any_vehicle_free", "trade_any_bicycle", "trade_any_bicycle_old"]) then {
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,"0",_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,"0",_activatingPlayer];
} else {
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
};
publicVariableServer "PVDZE_veh_Publish2";
[_part_out,_sign] spawn fn_waitForObject;
_keySelected;
};
//systemChat localize "STR_EPOCH_PLAYER_105"; // "Stand still to complete trade". Medic animation loop no longer used.

View File

@@ -1,4 +1,4 @@
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
private ["_sign","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
@@ -127,12 +127,12 @@ if (_finished) then {
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location;
_location = [_sign] call FNC_GetPos;
_location = (getPosATL _veh);
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer];
publicVariableServer "PVDZE_veh_Publish2";
[_part_out,_sign] spawn fn_waitForObject;
format[localize "STR_EPOCH_PLAYER_180",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
};

View File

@@ -1,4 +1,4 @@
private ["_veh","_location","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_playerNear"];
private ["_sign","_location","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_playerNear"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
@@ -104,14 +104,12 @@ if (_qty >= _qty_in) then {
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location;
_location = [_sign] call FNC_GetPos;
_location = (getPosATL _veh);
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer];
publicVariableServer "PVDZE_veh_Publish2";
player reveal _veh;
[_part_out,_sign] spawn fn_waitForObject;
format[localize "str_epoch_player_180",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
};

View File

@@ -1,4 +1,4 @@
private ["_veh","_location","_result","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
private ["_sign","_location","_result","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
@@ -132,12 +132,12 @@ if (_finished) then {
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location;
_location = [_sign] call FNC_GetPos;
_location = (getPosATL _veh);
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
publicVariableServer "PVDZE_veh_Publish2";
[_part_out,_sign] spawn fn_waitForObject;
format[localize "STR_EPOCH_ACTIONS_11",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
};

View File

@@ -1,4 +1,4 @@
private ["_veh","_location","_result","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_okToSell","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_playerNear"];
private ["_sign","_location","_result","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_okToSell","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_playerNear"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
@@ -110,14 +110,12 @@ if (_qty >= _qty_in) then {
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_location = (getPosATL _veh);
_sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location;
_location = [_sign] call FNC_GetPos;
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
publicVariableServer "PVDZE_veh_Publish2";
player reveal _veh;
[_part_out,_sign] spawn fn_waitForObject;
format["Bought %3 for %1 %2, key added to toolbelt.",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
} else {

View File

@@ -1,4 +1,4 @@
private ["_veh","_location","_result","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_keyColor","_damage","_tireDmg","_tires","_okToSell","_temp_keys","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
private ["_sign","_location","_result","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_keyColor","_damage","_tireDmg","_tires","_okToSell","_temp_keys","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
@@ -131,12 +131,12 @@ if (_finished) then {
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location;
_location = [_sign] call FNC_GetPos;
_location = (getPosATL _veh);
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
publicVariableServer "PVDZE_veh_Publish2";
[_part_out,_sign] spawn fn_waitForObject;
format[localize "STR_EPOCH_ACTIONS_11",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
};

View File

@@ -1,4 +1,4 @@
private ["_veh","_location","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
private ["_sign","_location","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
@@ -130,12 +130,12 @@ if (_finished) then {
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location;
_location = [_sign] call FNC_GetPos;
_location = (getPosATL _veh);
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,0,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,0,_activatingPlayer];
publicVariableServer "PVDZE_veh_Publish2";
[_part_out,_sign] spawn fn_waitForObject;
};
} else {

View File

@@ -1,4 +1,4 @@
private ["_veh","_location","_result","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_playerNear"];
private ["_sign","_location","_result","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_playerNear"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
@@ -117,12 +117,12 @@ if (_qty >= _qty_in) then {
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location;
_location = [_sign] call FNC_GetPos;
_location = (getPosATL _veh);
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
publicVariableServer "PVDZE_veh_Publish2";
[_part_out,_sign] spawn fn_waitForObject;
format["Bought %3 for %1 %2, key added to toolbelt.",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
} else {

View File

@@ -0,0 +1,12 @@
private ["_object","_sign"];
_object = _this select 0;
_sign = _this select 1;
waitUntil {
uiSleep 1;
!isNull (nearestObject [player,_object])
};
deleteVehicle _sign;
player reveal (nearestObject [player,_object]);

View File

@@ -166,6 +166,7 @@ if (!isDedicated) then {
epoch_returnChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf";
fn_pauseMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_pauseMenuChecks.sqf";
fn_waitForObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_waitForObject.sqf";
player_onPause = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_onPause.sqf";
player_addDuplicateTool = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_addDuplicateTool.sqf";
player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";

View File

@@ -1,11 +1,10 @@
private ["_activatingPlayer","_isOK","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey"];
//PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
_object = _this select 0;
_worldspace = _this select 1;
_class = _this select 2;
_donotusekey = _this select 3;
_keySelected = _this select 4;
_activatingPlayer = _this select 5;
private ["_activatingPlayer","_isOK","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey"];
//PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
_worldspace = _this select 0;
_class = _this select 1;
_donotusekey = _this select 2;
_keySelected = _this select 3;
_activatingPlayer = _this select 4;
if(_donotusekey) then {
_isOK = true;
@@ -21,7 +20,6 @@ if(_donotusekey) then {
_characterID = str(getNumber(configFile >> "CfgWeapons" >> _keySelected >> "keyid"));
};
diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0;
_location = _worldspace select 1;
_uid = _worldspace call dayz_objectUID2;
@@ -32,17 +30,16 @@ diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
// Switched to spawn so we can wait a bit for the ID
[_object,_uid,_characterID,_class,_dir,_location,_donotusekey,_activatingPlayer] spawn {
[_uid,_characterID,_class,_dir,_location,_donotusekey,_activatingPlayer] spawn {
private ["_object","_uid","_characterID","_done","_retry","_key","_result","_outcome","_oid","_class","_location","_object_para","_donotusekey","_activatingPlayer"];
_object = _this select 0;
_uid = _this select 1;
_characterID = _this select 2;
_class = _this select 3;
//_dir = _this select 4;
_location = _this select 5;
_donotusekey = _this select 6;
_activatingPlayer = _this select 7;
_uid = _this select 0;
_characterID = _this select 1;
_class = _this select 2;
//_dir = _this select 3;
_location = _this select 4;
_donotusekey = _this select 5;
_activatingPlayer = _this select 6;
_done = false;
_retry = 0;
@@ -55,7 +52,6 @@ _key call server_hiveWrite;
_outcome = _result select 0;
if (_outcome == "PASS") then {
_oid = _result select 1;
//_object setVariable ["ObjectID", _oid, true];
diag_log("CUSTOM: Selected " + str(_oid));
_done = true;
_retry = 100;
@@ -68,9 +64,6 @@ _key call server_hiveWrite;
};
};
// Remove marker
deleteVehicle _object;
if(!_done) exitWith { diag_log("CUSTOM: failed to get id for : " + str(_uid)); };
if(DZE_TRADER_SPAWNMODE) then {