saveMission - gruppe-adler/grad-persistence GitHub Wiki

grad_persistence_fnc_saveMission

Saves the current mission according to configuration. Has to be executed on server. Optionally shows a warning message before saving, so that players can leave their vehicles. (Players that are inside vehicles during saving will spawn dismounted, but inside the vehicle object.)

Syntax

[showWarning, waitTime, area] call grad_persistence_fnc_saveMission

Parameter Explanation
showWarning (optional) Bool - Show warning message before saving (default: false)
waitTime (optional) Number - Time in seconds before actual save happens (default: 10)
area (optional) Trigger/Marker/Location/Area-Array - Only save objects that are in this area.

Area array has the following format:
[center,a,b,angle,isRectangle,c]

Parameter Explanation
center Pos2D or Pos3D - Center of area
a Number - Radius 1 of area.
b (optional) Number - Radius 2 of area. (default: a)
angle (optional) Number - The angle that this area is rotated. (default: 0)
isRectangle (optional) Bool - Is this area a rectangle? (default: false)
c (optional) Number - Height of this area. (default: unlimited)

Example

[true,30] call grad_persistence_fnc_saveMission;
[false,0,trigger_1] call grad_persistence_fnc_saveMission;
[false,0,"marker_5"] call grad_persistence_fnc_saveMission;
[true,10,[2563,1423],60](/gruppe-adler/grad-persistence/wiki/2563,1423],60) call grad_persistence_fnc_saveMission;
[true,10,[534,2421,0],70,100,15,true,200](/gruppe-adler/grad-persistence/wiki/534,2421,0],70,100,15,true,200) call grad_persistence_fnc_saveMission;

Saving Periodically

To regularly save the mission, one option is to use a CBA perFrameHandler:

// add to initServer.sqf to save every 600 seconds:
[{[true, 10] call grad_persistence_fnc_saveMission}, 600, []] call CBA_fnc_addPerFrameHandler;