BetterDeadThanZed Posted March 20, 2015 Report Share Posted March 20, 2015 I was wondering if it's possible to make it so mission vehicles will be saved to the database if a player accesses it, but not save it otherwise. Any way to do this? Link to comment Share on other sites More sharing options...
ekroemer Posted March 20, 2015 Report Share Posted March 20, 2015 My understanding has been that that is already the case. Every mission file has the call to DZMSSaveVeh after the one to DZMSWaitMissionComp and DZMSWaitMissionComp only returns to the <mission>.sqf if the mission has been completed successfully: //Wait until the player is within 30 meters and also meets the kill req [_coords,"DZMSUnitsMajor"] call DZMSWaitMissionComp; //Call DZMSSaveVeh to attempt to save the vehicles to the database //If saving is off, the script will exit. [_vehicle] ExecVM DZMSSaveVeh; [_vehicle1] ExecVM DZMSSaveVeh; //Let everyone know the mission is over [nil,nil,rTitleText,"The Crash Site has been Secured by Survivors!", "PLAIN",6] call RE; diag_log text format["[DZMS]: Major EM1 C130 Mission has Ended."]; deleteMarker "DZMSMajMarker"; deleteMarker "DZMSMajDot"; //Let the timer know the mission is over DZMSMajDone = true; Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted March 20, 2015 Author Report Share Posted March 20, 2015 My understanding has been that that is already the case. Every mission file has the call to DZMSSaveVeh after the one to DZMSWaitMissionComp and DZMSWaitMissionComp only returns to the <mission>.sqf if the mission has been completed successfully That allows vehicles to be saved no matter what. I'd like to make it so if a player doesn't access the vehicle, it will disappear on restart, but if they get into it, it'll be written to the database. Link to comment Share on other sites More sharing options...
Psyfer Posted March 21, 2015 Report Share Posted March 21, 2015 Hi, Make sure DZMSSaveVehicles = true; in DZMSConfig.sqf. Comment out the line: [_vehicle] ExecVM DZMSSaveVeh; in the DZMS missions files (SM1.sqf etc). In DZMSFunctions.sqf there is a function called DZMSSetupVehicle. change this line: if (!(DZMSSaveVehicles)) then { _object addEventHandler ["GetIn",{ _nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: This vehicle will disappear on server restart!","PLAIN DOWN",5] call RE; }]; }; to this: if (!(DZMSSaveVehicles)) then { _object addEventHandler ["GetIn",{ _nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: This vehicle will disappear on server restart!","PLAIN DOWN",5] call RE; }]; } else { _object addEventHandler ["GetIn",{ _nil = [_this select 0] ExecVM DZMSSaveVeh; }]; }; This should work, although there is probably a better way to do it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now