To save the player`s loadout after they close the arsenal in Arma 3, put this code in the initPlayerLocal.sqf file.
This code will save the player loadout after the arsenal is closed.
[missionnamespace,"arsenalClosed", { [player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; titletext ["Arsenal loadout saved.", "PLAIN DOWN"]; }] call bis_fnc_addScriptedEventhandler; |
Print information about the player role when the arsenal is opened.
[missionnamespace,"arsenalOpened", { cuttext [format ["Welcome, your role is: %1.", getText(configFile >> "CfgVehicles" >> (typeOf player) >> "displayName")],"PLAIN DOWN",1]; }] call bis_fnc_addScriptedEventhandler; |
Allow the player to fully heal with a First Aid Kit.
player addEventHandler ["HandleHeal", { _this spawn { params ["_injured","_healer"]; missionNamespace setVariable ['Health',getDammage _injured,FALSE]; _damage = Health; if (_injured == _healer) then { waitUntil { damage _injured != _damage }; if (damage _injured < _damage) then { titletext ["You used Bandages and Morphine.", "PLAIN DOWN"]; _injured setDamage 0; }; }; }; }]; |
This is a very nice little script, put this in the init.sqf or the initPlayerLocal.sqf and this will work.
Holster weapon script. This allows the player to holster their weapon using the H key.
#include "\a3\editor_f\Data\Scripts\dikCodes.h" CLIENT_HolsterWeapon_KeyDown = { params ["_display", "_key", "_isShift", "_isCtrl", "_isAlt"]; private _handled = false; if (_key == DIK_H) then { switch ([animationState player, "P"] call KER_fnc_getAnimationState) do { case "erc": { player playMoveNow "amovpercmstpsnonwnondnon" }; case "knl": { player playMoveNow "amovpknlmstpsnonwnondnon" }; case "pne": { player playMoveNow "amovppnemstpsnonwnondnon" }; }; player action ["SwitchWeapon", player, player, -1]; PLAYER_WeaponGetIn = ""; _handled = true; }; _handled; }; |
It also requires this function to work.
// KER_fnc_getAnimationState private _animationState = param [0, "", [""]]; private _key = param [1, "", [""]]; switch (toLower _key) do { case "a": { _animationState select [1, 3] }; case "p": { _animationState select [5, 3] }; case "m": { _animationState select [9, 3] }; case "s": { _animationState select [13, 3] }; case "w": { _animationState select [17, 3] }; case "d": { _animationState select [21, 3] }; }; |
Run this code on the server when a mission ends to delete all objects on the ground, and all ruins and wrecks.
{deleteVehicle _x;} count (allMissionObjects "WeaponHolder"); {deleteVehicle _x;} count (allMissionObjects "StaticWeapon"); {deleteVehicle _x;} count allMines; {deleteVehicle _x;} count (allMissionObjects "Ruins"); |