Wraith_last 0 Posted April 11, 2021 Hello, I have the following script from an old post and it works about 50%. It is for saving loadout and position when logging. The Problem is it saves pos data but the loadouts are reset every time I log back in. Meaning I could log out in an area where enemies spawn with high powered rifles and I am running around with the starter pistol. He she is: TAG_fnc_loadClientData = { _this params ["_loadout", "_positionASL", "_dir"]; player setUnitLoadout _loadout; player setDir _dir; player setPosASL _positionASL; }; if(isServer) then { addMissionEventHandler [ "HandleDisconnect", { params ["_body", "_id", "_uid", "_name"]; if(!isNull _body) then { //Init storage var if(isNil "TAG_disconnectedLoadouts") then { TAG_disconnectedLoadouts = []; }; //Get data private _loadout = getUnitLoadout _body; private _position = getPos _body; private _direction = getDir _body; //Find in storage private _uidIndex = TAG_disconnectedLoadouts find _uid; if(_uidIndex > -1) then { //Found -> update private _loadoutIndex = _uidIndex + 1; TAG_disconnectedLoadouts set [_loadoutIndex, [_loadout, _position, _direction]]; } else { //Not found -> Add new TAG_disconnectedLoadouts pushBack _uid; TAG_disconnectedLoadouts pushBack [_loadout, _position, _direction]; }; }; false } ]; addMissionEventHandler [ "PlayerConnected", { params ["_id", "_uid", "_name", "_jip", "_owner"]; if(_jip) then { private _clientData = missionNamespace getVariable ["TAG_disconnectedLoadouts", []]; private _uidIndex = _clientData find _uid; if(_uidIndex > -1) then { private _loadoutIndex = _uidIndex + 1; (_clientData select _loadoutIndex) remoteExec ["TAG_fnc_loadClientData", _owner]; }; }; } ]; }; Any help would be gladly recived. Share this post Link to post Share on other sites
Wraith_last 0 Posted April 11, 2021 Never mind I solved it. Thanks anyway if you had a look. Share this post Link to post Share on other sites