Configurations#
Cleanup settings#
The cleanup is a function for deleting vehicles from the world and the AP database, depending on your settings. The cleanup will be performed after a server or script restart if you set onScriptRestart = true and/or onServerStart = true. A cleanup will also be performed when you add times = {} in the config.
It will not remove all data from the database and not all vehicles from the server. Only vehicles that match the cleanup config conditions will be removed.
ThresholdTime#
The thresholdTime is just the holding time for a vehicle. It doesn't matter how often or when you perform a cleanup, it will not affect whether a cleanup occurs.
As long as the thresholdTime is not nil, it will be checked during a cleanup. Every vehicle that is saved in AP will be checked against the thresholdTime. If a vehicle has been standing in the world without an update (entering or exiting the vehicle, taking damage, or being moved) for the time set as thresholdTime or longer, it will be cleaned up/removed.
Example
Server restarts at 00:00 o'clock, and cleanup is activated at server start.
Vehicle A was last updated at 23:00 o'clock.
Vehicle B was last updated at 14:00 o'clock.
Solution: Vehicle A and B will not be removed and will remain in the AP database.
Server restarts at 00:00 o'clock, and cleanup is activated at server start.
Vehicle A was last updated at 23:00 o'clock.
Vehicle B was last updated at 14:00 o'clock.
Solution: Both vehicles will be removed.
Server restarts at 00:00 o'clock, and cleanup is activated at server start.
Vehicle A was last updated at 23:00 o'clock.
Vehicle B was last updated at 14:00 o'clock.
Solution: Vehicle B will be removed, as it has been standing longer than 6 hours (thresholdTime) in the world.
Vehicle A will stay, as its last update was less than 6 hours ago (thresholdTime).
EngineThreshold#
The engineThreshold is simply the minimum health required for a vehicle. It doesn't matter how often or when you perform a cleanup, it will not affect whether a cleanup occurs.
As long as the engineThreshold is not nil, it will be checked during a cleanup. Every vehicle will be checked for its engine health. If you set allVehicles = true, then all vehicles will be checked. Otherwise, only saved vehicles will be checked. All vehicles that have engine health equal to or below the engineThreshold value will be cleaned up/removed.
Example
Server restarts and cleanup is activated at server start.
Vehicle A has 900 engine health and is not saved.
Vehicle B has 960 engine health and is saved.
Vehicle C has 450 engine health and is not saved.
Vehicle D has 560 engine health and is saved.
Solution: Vehicle A will stay. Vehicle B will stay. Vehicle C will stay. Vehicle D will be removed.
Server restarts and cleanup is activated at server start.
Vehicle A has 900 engine health and is not saved.
Vehicle B has 960 engine health and is saved.
Vehicle C has 450 engine health and is not saved.
Vehicle D has 560 engine health and is saved.
Solution: Vehicle A will stay. Vehicle B will stay. Vehicle C will be removed. Vehicle D will be removed.
Server restarts and cleanup is activated at server start.
Vehicle A has 900 engine health and is not saved.
Vehicle B has 960 engine health and is saved.
Vehicle C has 450 engine health and is not saved.
Vehicle D has 560 engine health and is saved.
Solution: Vehicle A will stay. Vehicle B will stay. Vehicle C will stay. Vehicle D will stay.
DistanceThreshold#
The distanceThreshold is the minimum distance between player and vehicle. It doesn't matter how often or when you perform a cleanup, it will not affect whether a cleanup occurs.
As long as the distanceThreshold is not nil, it will be checked during a cleanup. Every vehicle will be checked for its distance to a player. If you set allVehicles = true, all vehicles will be checked. Otherwise, only saved vehicles will be checked. All vehicles that are farther away from any player than the distanceThreshold will be removed.
Example
Server restarts and cleanup is activated at server start.
Vehicle A is 200 meters away from a player and is not saved.
Vehicle B is 300 meters away from a player and is saved.
Vehicle C is 90 meters away from a player and is not saved.
Vehicle D is 80 meters away from a player and is saved.
Solution: Vehicle A will stay. Vehicle B will be removed. Vehicle C will stay. Vehicle D will stay.
Server restarts and cleanup is activated at server start.
Vehicle A is 200 meters away from a player and is not saved.
Vehicle B is 300 meters away from a player and is saved.
Vehicle C is 90 meters away from a player and is not saved.
Vehicle D is 80 meters away from a player and is saved.
Solution: Vehicle A will be removed. Vehicle B will be removed. Vehicle C will stay. Vehicle D will stay.
Server restarts and cleanup is activated at server start.
Vehicle A is 200 meters away from a player and is not saved.
Vehicle B is 300 meters away from a player and is saved.
Vehicle C is 90 meters away from a player and is not saved.
Vehicle D is 80 meters away from a player and is saved.
Solution: Vehicle A will stay. Vehicle B will stay. Vehicle C will stay. Vehicle D will stay.
SubmergedVehicles#
The submergedVehicles setting determines whether vehicles submerged underwater will be removed when Ap is trying to respawn them. It will not remove the vehicle on a cleanup. It doesn't matter how often or when you perform a cleanup; it will not affect whether a cleanup occurs.
- If submergedVehicles = false, no submerged vehicles will be removed.
- If submergedVehicles = true and allVehicles = false, only saved vehicles will be removed if they are submerged.
- If submergedVehicles = true and allVehicles = true, all submerged vehicles will be removed.