Addon: disclaimer - Nomas-X/AET_AUX GitHub Wiki
Description
This addon handles the on join disclaimer and weapon safety. We will go over its functionality, and how it is utilized.
How It Works
When a player joins the server he will be checked to determine if he has already seen the disclaimer for this mission. If he has not seen the disclaimer then the disclaimer and weapon safety function will run. If the player has already seen the disclaimer then he will not see it again for the duration of this mission. The weapon safety is enabled once the player joins unless the addon option for it is set to no safety. The safety removal can be done by multiple different ways including by a custom disclaimer or intro. The below picture shows how the disclaimer looks to the player:
Addon Options
In the below picture you can see the list of addon options that this addon provides:
- Disclaimer
- Enable Disclaimer: Controls if the disclaimer is shown.
- Enable Sponsor Logo: Controls if the sponsor logo is shown during the disclaimer.
- Disable In Editor Preview: Controls if the disclaimer is shown in the editor preview.
- Disclaimer Text: Sets the disclaimer text. The string is used with the cutText command in the disclaimer.
- Disclaimer Sponsor Logo: Sets the sponsor's logo. The string used with the cutText command in the disclaimer to show the sponsor logo.
- Custom Intro File Path: Sets the file path used to call your script within the disclaimer. Safety, removal of black screen and more is all already handled, this is done to allow you to add your own text, images, or more. The file will be executed in a scheduled environment.
- Weapon Safety
- Disable Weapon Safety Based On: Controls the mode the safety is handled with if any:
- No Safety: Weapon safety will not be turned on.
- Disclaimer End: Weapon safety will be turned on until the disclaimer ends.
- Time: Weapon safety will be turned on until the chosen amount of time has passed since mission start.
- Distance: Weapon safety will be turned on until the player has made it as far as the chosen distance from his spawn location.
- Time Based Safety Removal (Mission Time): Sets the needed time to pass since mission start before safety is removed automatically if mode is set to Time.
- Distance Based Safety Removal (In Meters): Sets the needed distance the player must be away from his spawn point before safety is removed automatically if mode is set to Distance.
- Disable Weapon Safety Based On: Controls the mode the safety is handled with if any:
Custom Disclaimer / Intro
There are two ways to run your own intro, disclaimer or script either during the main disclaimer or after. We will go over the details of both.
During The Disclaimer
Right after the main disclaimer text and sponsor logo are shown, the disclaimer will check the provided file path in the Custom Intro File Path
CBA setting and call the file directly into the disclaimer. The disclaimer it self runs in a scheduled environment. The black screen removal is handled automatically at the end of the disclaimer, and so is safety if it is set to Disclaimer End
. To understand where and how your custom disclaimer / intro is called check the following function here.
After The Disclaimer
You are able to hook onto the disclaimer by a CBA event handler to run any script or function as soon as the disclaimer is done. This also works if you include a custom disclaimer as the end of the disclaimer will still be handled the same. To hook onto the disclaimer's end simply use the following code in initPlayerLocal.sqf
. The code will run only if the player sees the disclaimer, meaning a re-joining player will not trigger this:
["AET_disclaimer_EH_done", {
//... code ... //
}] call CBA_fnc_addEventHandler;
Custom Safety Removal
If you would like to disable safety after you have set the CBA setting Disable Weapon Safety Based On
to Custom
then simply run the following code locally on the player you wish to disable the weapon safety off:
[false] call AET_disclaimer_fnc_handlesafety;