Gear deleted on skin change?

When my players switch skins their main inventory, back pack, and secondary inventory get deleted. It happens to me and my admins as well so it's probably not my antihack. We just updated our Arma and Epoch, and we run an Overpoch server, anybody else having this issue or know of a fix?
 
This is my player_switchModel.sqf
Code:
private ["_class","_position","_dir","_group","_oldUnit","_newUnit","_currentWpn","_muzzles","_currentAnim","_playerUID","_weapons","_magazines","_primweapon","_secweapon","_playerObjName","_wpnType","_ismelee","_tagSetting"];
_class             = _this;

_position         = getPosATL player;
_dir             = getDir player;
_currentAnim     = animationState player;

_tagSetting = player getVariable["DZE_display_name",false];

//Get PlayerID
_playerUID = getPlayerUID player;

//BackUp Weapons and Mags
_weapons     = weapons player;
_magazines    = call player_countmagazines; //magazines player;

if ( (_playerUID == dayz_playerUID) && (count _magazines == 0) && (count (magazines player) > 0 )) exitWith {cutText [(localize "str_epoch_player_17"), "PLAIN DOWN"]};

_primweapon    = primaryWeapon player;
_secweapon    = secondaryWeapon player;

//Checks
if(!(_primweapon in _weapons) && _primweapon != "") then {
    _weapons = _weapons + [_primweapon];
};

if(!(_secweapon in _weapons) && _secweapon != "") then {
    _weapons = _weapons + [_secweapon];
};

//Get Muzzle
_currentWpn = currentWeapon player;
_muzzles = getArray(configFile >> "cfgWeapons" >> _currentWpn >> "muzzles");
if (count _muzzles > 1) then {
    _currentWpn = currentMuzzle player;
};

//Secure Player for Transformation
player setPosATL dayz_spawnPos;

//BackUp Player Object
_oldUnit = player;
_oldGroup = group player;
   
/**********************************/
//DONT USE player AFTER THIS POINT//
/**********************************/

//Create New Character
//[player] joinSilent grpNull;
_group         = createGroup west;
_newUnit     = _group createUnit [_class,dayz_spawnPos,[],0,"NONE"];

_newUnit     setPosATL _position;
_newUnit     setDir _dir;

//Clear New Character
{_newUnit removeMagazine _x;} forEach  magazines _newUnit;
removeAllWeapons _newUnit;   

//Equip New Charactar
{
    if (typeName _x == "ARRAY") then {_newUnit addMagazine [_x select 0,_x select 1] } else { _newUnit addMagazine _x };
} forEach _magazines;
   
{
    _newUnit addWeapon _x;
} forEach _weapons;

//Check and Compare it
if(str(_weapons) != str(weapons _newUnit)) then {
    //Get Differecnce
    {
        _weapons = _weapons - [_x];
    } forEach (weapons _newUnit);
   
    //Add the Missing
    {
        _newUnit addWeapon _x;
    } forEach _weapons;
};
   
if(_primweapon !=  (primaryWeapon _newUnit)) then {
    _newUnit addWeapon _primweapon;       
};

if (_primweapon == "MeleeCrowbar") then {
    _newUnit addMagazine 'crowbar_swing';
};
if (_primweapon == "MeleeSledge") then {
    _newUnit addMagazine 'sledge_swing';
};
if (_primweapon == "MeleeHatchet_DZE") then {
    _newUnit addMagazine 'Hatchet_Swing';
};
if (_primweapon == "MeleeMachete") then {
    _newUnit addMagazine 'Machete_swing';
};
if (_primweapon == "MeleeFishingPole") then {
    _newUnit addMagazine 'Fishing_Swing';
};

if(_secweapon != (secondaryWeapon _newUnit) && _secweapon != "") then {
    _newUnit addWeapon _secweapon;       
};

//Make New Unit Playable
addSwitchableUnit _newUnit;
setPlayable _newUnit;
selectPlayer _newUnit;
if ((count units _oldGroup > 1) && (!isNil "PVDZE_plr_LoginRecord")) then {[player] join _oldGroup;};

//Clear and delete old Unit
removeAllWeapons _oldUnit;
{_oldUnit removeMagazine _x;} forEach  magazines _oldUnit;
       
deleteVehicle _oldUnit;

//Move player inside

if(_currentWpn != "") then {_newUnit selectWeapon _currentWpn;};
[objNull, player, rSwitchMove,_currentAnim] call RE;
//dayz_originalPlayer attachTo [_newUnit];
player disableConversation true;
   
//player setVariable ["bodyName",dayz_playerName,true]; //Outcommit (Issue #991) - Also removed in DayZ Mod 1.8

if (_tagSetting) then {
    DZE_ForceNameTags = true;
};

_playerUID = getPlayerUID player;
_playerObjName = format["PVDZE_player%1",_playerUID];
call compile format["%1 = player;",_playerObjName];
publicVariableServer _playerObjName; //Outcommit in DayZ 1.8 No clue for what this is - Skaronator
   
//melee check
_wpnType = primaryWeapon player;
_ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee"));
if (_ismelee == "true") then {
    call dayz_meleeMagazineCheck; 
};
       
//reveal the same objects we do on login
{player reveal _x} forEach (nearestObjects [getPosATL player, dayz_reveal, 50]);
 
If your updated your Epoch to 1.0.5.1 then you have to use the new version of player_switchModel.sqf ;)
I recommend you to check other dayz_code related files either :p
 
If your updated your Epoch to 1.0.5.1 then you have to use the new version of player_switchModel.sqf ;)
I recommend you to check other dayz_code related files either :p
Hmm. I looked over the new play_switchModel.sqf from the new epoch and it seemed the same, but I'll try it. Kinda sucks because I'm using Ebay's Group System and it uses that file.
 
As SchwEde said, you should always get the newest default files from @DayZ_YourMod\addons\dayz_code when ever there is a major update. Then redo your customizations by comparing the old default files to your old custom files using something like Notepad++ compare tool. The devs made significant changes to this file and many others in the Epoch 1.0.5+ update.

For group management you only need to change two lines, so it is simple to redo.
Thanks ebay, is there a list of the files they changed? I looked into the change log but either they didn't add that or the ones I was looking at didn't list them. We're also having quite a lot of problems with the overwatch side of our server at the moment, along with the overwatch traders.
 
Back
Top