mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Done is Done, make the rest of it to a localSetVariable
This commit is contained in:
@@ -58,24 +58,12 @@ if(!isNull _obj) then {
|
|||||||
_holder setVariable["ObjectUID",_objectUID,true];
|
_holder setVariable["ObjectUID",_objectUID,true];
|
||||||
_holder setVariable ["OEMPos", _pos, true];
|
_holder setVariable ["OEMPos", _pos, true];
|
||||||
|
|
||||||
_weapons = getWeaponCargo _obj;
|
PVDZE_obj_setlocalVars = [_obj,_holder];
|
||||||
_magazines = getMagazineCargo _obj;
|
publicVariableServer "PVDZE_obj_setlocalVars";
|
||||||
_backpacks = getBackpackCargo _obj;
|
|
||||||
|
|
||||||
// remove vault
|
// remove vault
|
||||||
deleteVehicle _obj;
|
deleteVehicle _obj;
|
||||||
|
|
||||||
// Fill variables with loot
|
|
||||||
if (count _weapons > 0) then {
|
|
||||||
_holder setVariable ["WeaponCargo", _weapons, true];
|
|
||||||
};
|
|
||||||
if (count _magazines > 0) then {
|
|
||||||
_holder setVariable ["MagazineCargo", _magazines, true];
|
|
||||||
};
|
|
||||||
if (count _backpacks > 0) then {
|
|
||||||
_holder setVariable ["BackpackCargo", _backpacks, true];
|
|
||||||
};
|
|
||||||
|
|
||||||
cutText [format[(localize "str_epoch_player_117"),_text], "PLAIN DOWN"];
|
cutText [format[(localize "str_epoch_player_117"),_text], "PLAIN DOWN"];
|
||||||
};
|
};
|
||||||
s_player_lockvault = -1;
|
s_player_lockvault = -1;
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ if (isServer) then {
|
|||||||
"PVDZE_plr_TradeMenu" addPublicVariableEventHandler {(_this select 1) spawn server_traders};
|
"PVDZE_plr_TradeMenu" addPublicVariableEventHandler {(_this select 1) spawn server_traders};
|
||||||
"PVDZE_plr_DeathB" addPublicVariableEventHandler {(_this select 1) spawn server_deaths};
|
"PVDZE_plr_DeathB" addPublicVariableEventHandler {(_this select 1) spawn server_deaths};
|
||||||
|
|
||||||
"PVDZE_obj_localVars" addPublicVariableEventHandler {(_this select 1) spawn server_getLocalObjVars};
|
"PVDZE_obj_getlocalVars" addPublicVariableEventHandler {(_this select 1) spawn server_getLocalObjVars};
|
||||||
|
"PVDZE_obj_setlocalVars" addPublicVariableEventHandler {(_this select 1) spawn server_setLocalObjVars};
|
||||||
};
|
};
|
||||||
|
|
||||||
//Client only
|
//Client only
|
||||||
|
|||||||
@@ -915,3 +915,24 @@ server_getLocalObjVars = {
|
|||||||
PVDZE_localVarsResult = _vals;
|
PVDZE_localVarsResult = _vals;
|
||||||
(owner _player) publicVariableClient "PVDZE_localVarsResult";
|
(owner _player) publicVariableClient "PVDZE_localVarsResult";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
server_setLocalObjVars = {
|
||||||
|
private ["_obj", "_holder", "_weapons", "_magazines", "_backpacks"];
|
||||||
|
|
||||||
|
_obj = _this select 0;
|
||||||
|
_holder = _this select 1;
|
||||||
|
|
||||||
|
_weapons = getWeaponCargo _obj;
|
||||||
|
_magazines = getMagazineCargo _obj;
|
||||||
|
_backpacks = getBackpackCargo _obj;
|
||||||
|
|
||||||
|
if (count _weapons > 0) then {
|
||||||
|
_holder setVariable ["WeaponCargo", _weapons];
|
||||||
|
};
|
||||||
|
if (count _magazines > 0) then {
|
||||||
|
_holder setVariable ["MagazineCargo", _magazines];
|
||||||
|
};
|
||||||
|
if (count _backpacks > 0) then {
|
||||||
|
_holder setVariable ["BackpackCargo", _backpacks];
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user