Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Script run to purchase supply drops from the map menu - By BobTheHunted
- // nul = [type,cost,side,position] call BTH_fnc_SupplyDrop
- // type: Classname - Type of ammobox to create
- // cost:--- Number - Resource cost of ammobox
- // call:--- Object - Player that requested the supply drop
- // Example: nul = ["Box_NATO_Ammo_F",150,player,(position player)] spawn BTH_fnc_SupplyDrop;
- params [
- ['_ammoType',"",[""]],
- ['_ammoCost',0,[0]],
- ['_ammoSide',resistance,[civilian]],
- ['_ammoPos',[0,0,0],[[0,0,0]]]
- ];
- if (_ammoSide == civilian) exitWith {hint "Civilians shouldn't have this you reckless fuck";};
- private _p_balance = [WEST_balance , EAST_balance, GUER_balance] select ([west, east, resistance] find _ammoSide);
- if (_p_balance >= _ammoCost) then {
- [_ammoCost,_ammoSide,false] call BTH_fnc_HandleBalance;
- private _ammoBox = createVehicle [_ammoType, [0,0,100], [], 0, ""];
- private _para = createVehicle ["B_Parachute_02_F", [0,0,125], [], 0, ""];
- _ammoBox attachTo [_para,[0,0,0]];
- _ammoBox allowDamage false;
- _ammoBox setDamage 0;
- _para setPosATL [(_ammoPos select 0),(_ammoPos select 1),(_ammoPos select 2) + 125];
- private _ammoSmoke = "SmokeShellRed" createVehicle (position _ammoBox);
- private _ammoLight = "NVG_TargetW" createVehicle (position _ammoBox);
- _ammoSmoke attachTo [_ammoBox, [0,0,0.5]];
- _ammoLight attachTo [_ammoBox, [0,0,0.5]];
- waitUntil {(getPosATL _ammoBox select 2) < 1};
- detach _ammoBox;
- _ammoBox setVelocity [0,0,-5];
- sleep 0.4;
- deleteVehicle _ammoLight;
- _ammoBox setPos [(position _ammoBox) select 0, (position _ammoBox) select 1, 1];
- _ammoBox setVelocity [0,0,0];
- _ammoBox allowDamage true;
- hintSilent "Supplies have arrived";
- } else {
- hint "You cannot afford that supply drop!"
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement