This simple code will start a mortar strike on an enemy position when a vehicle is destroyed.
car1 addEventHandler [ 'Killed', { _bombardment = [BIS_Mortar,getMarkerPos "mk2","8Rnd_82mm_Mo_shells",100,24,10] execVM "a3\missions_f_exp\showcases\showcase_endgame.tanoa\scripts\firesupport.sqf"; }]; |
Name the mortar BIS_Mortar, then place a marker on the location to be shelled, named mk2. When the vehicle named “car1” is destroyed, the mortar will start firing on the marker location. This is a very useful script I found in the game files. And I hope you find it very useful also.
Here is some useful code I put in a Patrol Ops mission I recoded. This will punish players that fire at base. Just call this within a fired event handler and it will take the ammo off then and delete their bullets.
b3_protector_telloff = { private ["_player", "_projectile"]; _player = _this select 0; _projectile = _this select 1; ["Papabear", "Stop firing at base soldier! You are firing blanks."] call BIS_fnc_showSubtitle; { if ( _x in primaryWeaponMagazine player ) then { player removeMagazine _x } } forEach magazines player; removeAllPrimaryWeaponItems player; ("CMflareAmmo" createVehicle [0,0,1e9]) attachTo [_projectile, [0,0,0]]; deletevehicle _projectile; papabear sidechat format ["Player:%1, player's side:%2 is firing at base!", player, side player]; }; |
This also removes their weapon accessories, such as a scope and other equipment. And attaching a flare ammo smoke puff to their bullet, before deleting it. Very funny and cool script.
Another way to call in fire support is to use this function.
[man1,"Sh_82mm_AMOS",100,24,10,"!alive man1", 32, 4900, 150] spawn BIS_fnc_fireSupportVirtual; |
This will spawn 82mm mortar rounds 4900 meters up that will bombard an area. This fire support will stop when the target, “man1” is dead.
To save a player`s inventory in a vanilla Arma 3 mission, use this code in the onPlayerKilled.sqf
[player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; |
Then, in the onPlayerRespawn.sqf, put this code.
[player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory; |
This will load the player`s last loadout when they respawn.
Spawn a patrol group on a location and ask them to patrol an area. I am spawning them next to a building named building1.
_hqdef2 = building1 getRelPos [-96, 256]; _group = [_hqdef2, RESISTANCE, (configfile >> "CfgGroups" >> "Indep" >> "IND_C_F" >> "Infantry" >> "ParaCombatGroup")] call BIS_fnc_spawnGroup; [_group, getPos man1, 300] call bis_fnc_taskPatrol; |