node 10 Posted April 12, 2015 I am on an Altis Life mission file, is it possible to make it to were after a server restart if any players vehicles are not saved into a garage it will automatically save them? Here is the script for storing your vehicle(s) private["_nearVehicles","_vehicle"]; if(vehicle player != player) then { _vehicle = vehicle player; } else { _nearVehicles = nearestObjects[getPos (_this select 0),["Car","Air","Ship"],30]; //Fetch vehicles within 30m. if(count _nearVehicles > 0) then { { if(!isNil "_vehicle") exitWith {}; //Kill the loop. _vehData = _x getVariable["vehicle_info_owners",[]]; if(count _vehData > 0) then { _vehOwner = (_vehData select 0) select 0; if((getPlayerUID player) == _vehOwner) exitWith { _vehicle = _x; }; }; } foreach _nearVehicles; }; }; if(isNil "_vehicle") exitWith {hint localize "STR_Garage_NoNPC"}; if(isNull _vehicle) exitWith {}; [[_vehicle,false,(_this select 1)],"TON_fnc_vehicleStore",false,false] spawn life_fnc_MP; hint localize "STR_Garage_Store_Server"; life_garage_store = true; Share this post Link to post Share on other sites
[evo] dan 79 Posted April 13, 2015 have you tried looking at the BIKI for saveProfileNamespace? Share this post Link to post Share on other sites
node 10 Posted April 13, 2015 Ok I have looked at the BIKI for it but how would I get it to save vehicles after restart? The biki doesn't really give a good description on how to use it. Share this post Link to post Share on other sites
[evo] dan 79 Posted April 14, 2015 On init of the mission, get it to check the variable with https://community.bistudio.com/wiki/profileNamespace Use saveProfileNamespace to save the vairable. Just use getVariable on the namespace to retrieve it on init and then use any spawning code to place them correctly. Share this post Link to post Share on other sites
node 10 Posted April 14, 2015 (edited) so like this profileNamespace setVariable ["life_garage_store",[]]; _vehicle = profileNamespace getVariable "life_garage_store"; if(isNil "_vehicle") exitWith {hint localize "STR_Garage_NoNPC"}; if(isNull _vehicle) exitWith {}; [[_vehicle,false,(_this select 1)],"TON_fnc_vehicleStore",false,false] spawn life_fnc_MP; hint localize "STR_Garage_Store_Server"; life_garage_store = true; Edited April 14, 2015 by Node Share this post Link to post Share on other sites
callmejaf 0 Posted October 12, 2016 Hi, long story short, I own a lakeside server and have no idea how to script, how should I add script that saves the vehicles in garage after restart? Share this post Link to post Share on other sites
Valdas Stonkus 0 Posted May 7, 2017 On 2015-04-13 at 1:49 AM, node said: I am on an Altis Life mission file, is it possible to make it to were after a server restart if any players vehicles are not saved into a garage it will automatically save them? Here is the script for storing your vehicle(s) private["_nearVehicles","_vehicle"]; if(vehicle player != player) then { _vehicle = vehicle player; } else { _nearVehicles = nearestObjects[getPos (_this select 0),["Car","Air","Ship"],30]; //Fetch vehicles within 30m. if(count _nearVehicles > 0) then { { if(!isNil "_vehicle") exitWith {}; //Kill the loop. _vehData = _x getVariable["vehicle_info_owners",[]]; if(count _vehData > 0) then { _vehOwner = (_vehData select 0) select 0; if((getPlayerUID player) == _vehOwner) exitWith { _vehicle = _x; }; }; } foreach _nearVehicles; }; }; if(isNil "_vehicle") exitWith {hint localize "STR_Garage_NoNPC"}; if(isNull _vehicle) exitWith {}; [[_vehicle,false,(_this select 1)],"TON_fnc_vehicleStore",false,false] spawn life_fnc_MP; hint localize "STR_Garage_Store_Server"; life_garage_store = true; I have the same problem, after server restart, vehicles that are not stored in garage, just disappears. I use Altis life v5. Your provide script not working for me. Could you help me ion this please? Share this post Link to post Share on other sites
Valdas Stonkus 0 Posted May 8, 2017 I found a solution, there is not need any help. Share this post Link to post Share on other sites
Midnighters 152 Posted May 8, 2017 Just remember that profileNamespace pertains to the profile and not just the user, so if the user switches profiles > data isnt going to be found Share this post Link to post Share on other sites