mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 11:42:38 +03:00
This reverts 4b171cb.
player_regularSave should only be used if player_forceSave would interrupt an action like fire a weapon since it opens a dialog. player_regularSave does not save the ammo count but all magazines. Do not use nil instead of the magazines player array since it makes duping possible.
Thx to mmrsz
17 lines
609 B
Plaintext
17 lines
609 B
Plaintext
/*
|
|
|
|
Opens player inventory to save
|
|
Do not use this in constant running loops or actions. force_Save opens the inventory with a dialog call.
|
|
That will interrupt actions like shooting. For loops use player_regularSave but keep in mind player_regularSave does not save the ammo count.
|
|
|
|
*/
|
|
|
|
local _magazineArray = [] call player_countMagazines;
|
|
|
|
PVDZ_plr_Save = [player, if (player isKindOf "PZombie_VB") then {nil} else {_magazineArray},dayz_onBack,weapons player];
|
|
publicVariableServer "PVDZ_plr_Save";
|
|
|
|
//diag_log format["Player_forceSave with magazines: %1",_magazineArray];
|
|
|
|
dayz_lastSave = diag_tickTime;
|