Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counterartillery Script #2

Open
MildlyInterested opened this issue Dec 4, 2023 · 0 comments
Open

Counterartillery Script #2

MildlyInterested opened this issue Dec 4, 2023 · 0 comments

Comments

@MildlyInterested
Copy link
Contributor

//initServer.sqf
//Trigger LAMBS Counter Artillery every time the 60mm light mortar is fired
["UK3CB_BAF_Static_M6", "Fired", { 
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    [{
        params ["_unit"];
        [selectRandom [gun1, gun2, gun3, gun4], getPos _unit, spotter1, 5, 1, true] call lambs_wp_fnc_taskArtillery;
        [selectRandom [gun1, gun2, gun3, gun4], getPos _unit, spotter1, 5, 1, true] call lambs_wp_fnc_taskArtillery;
        // [gun3, getPos _unit, nil, 5, 25, true] call lambs_wp_fnc_taskArtillery;
        // [gun4, getPos _unit, nil, 5, 25, true] call lambs_wp_fnc_taskArtillery;
    }, [_unit], floor random [0, 10, 30]] call CBA_fnc_waitAndExecute;
}, true, [], true] call CBA_fnc_addClassEventHandler;
//init.sqf
//Shoot 5 rounds every time the MLRS artillery is called
["lambs_danger_OnArtilleryCalled", {
    params ["_unitThatCalledArtillery", "_groupOfUnit", "_ArtilleryGun", "_TargetPosition"];
    if (!local _ArtilleryGun) exitWith {};
    _ArtilleryGun setVehicleAmmo 1;
    if (typeOf _ArtilleryGun == "RHS_BM21_VV_01") then {
        [{
            params ["_ArtilleryGun", "_TargetPosition"];
            _ArtilleryGun commandArtilleryFire [_TargetPosition, "rhs_mag_m21of_1", 7];
        }, [_ArtilleryGun,_TargetPosition], 45] call CBA_fnc_waitAndExecute;
    };
}] call CBA_fnc_addEventHandler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant