Skip to content

Instantly share code, notes, and snippets.

/*
Function: ACE_fnc_deleteLoadCargo
Description:
A function used to delete cargo from a vehicle.
Parameters:
_veh - Vehicle to load cargo into. (Must exist) [Object]
_cargo - Cargo object to load. (Must exist) [Array of one or more objects]
Returns:
nothing
@bosoy
bosoy / BIS_fnc_configExtremes.sqf
Created December 9, 2017 20:36
BIS_fnc_configExtremes (arma 3) for arma 2
/*
Author: Karel Moricky
Description:
Scan config paths and return min and max values for each property.
Can be used only for properties of type number and array (value is geometric mean of all numbers in the array)
Parameter(s):
0: ARRAY of CONFIGs - scanned paths. Most often result of configClasses command
1: ARRAY or STRINGs - properties, e.g., ["maxRange","reloadTime"]
@bosoy
bosoy / BIS_fnc_param.sqf
Created December 9, 2017 20:33
BIS_fnc_param for arma 2
/*
Author: Karel Moricky
Description:
Define script parameter
Parameter(s):
_this select 0: ARRAY - list of params
_this select 1: NUMBER - selected index
_this select 2 (Optional): ANY - default param (used when param is missing or of wrong type)
@bosoy
bosoy / fnc_configclasses.sqf
Last active December 9, 2017 19:39
аналог configclasses из а3
/*
Autor^ Dimon UA
Description:
Returns an array of config entries which meet criteria in condition code.
Command iterates through all available config sub classes of the given config class.
Current looked at config is stored in _x variable (similar to alternative count command implementation).
Condition has to return true in order for the looked at config to be added to the resulting array.
Syntax:
[config,condition] call fnc_configClasses
/*
File: BD_fnc_formatarraybaseParent.sqf
Author: Dimon UA
Description:
formatting array of classes on basic parent sign
Parameter(s):
_this: array of classes
/*
File: fn_returnbaseParents.sqf
Author: Dimon UA
Description:
Returns list of base parent classes
Parameter(s):
_this select 0: starting config class (Config)
_this select 1: true if you want to return only classnames (Boolean)
ACE_player addEventHandler ["SeatSwitchedMan",
{
_this spawn
{
showhud false;
disableUserInput true ;
titleText ["Пересаживаюсь", "BLACK OUT",.15];
playSound3D ["rhsafrf\addons\rhs_t72\sounds\T72_inside_door1.wss", (this select 0), false, getPosASL (this select 0), 1, 1, 0];
sleep 4;
titleFadeOut 20;
if (secondaryweapon player call bis_fnc_baseWeapon == "rhs_weap_rpg7" && {(secondaryweapon player != currentweapon player)}) then
{
private ["_magazine"];
_magazine = (secondaryWeaponMagazine player) select 0;
if !(isnil "_magazine") then
{
player removeSecondaryWeaponItem _magazine;
if (player canAddItemToBackpack _magazine) then
{
player addItemToBackpack _magazine;
/*
Функция контроля экипажа техники.
Автор: Dimon UA
Параметры:
0. _this - по умолчанию
1. - места что блокируются
"driver"
"gunner"
"commander" - блокировка места командира - разрешено только для arrRelCommander
#define PROJECT_PREFIX SerP
#define COMPONENT_NAME blnd
#define PSGVAR(VAR1,VAR2) (player setVariable ['PROJECT_PREFIX##_##COMPONENT_NAME##_var_##VAR1',VAR2,true])
#define OSGVAR(VAR1,VAR2,VAR3) (VAR1 setVariable ['PROJECT_PREFIX##_##COMPONENT_NAME##_var_##VAR2',VAR3,true])
dim_MR_array_KC=_this select 0; //массив КСов
ongrouparray=_this select 1; // массив командиров отделений которые можно передвигать
onspecgrouparray= if (count (_this)>2) then{_this select 2}else{nil}; // массив командиров отделений (по типу СПН, но не обязательно) и подмассив маркеров для каждого отделения в которых можно расположить отделения
arraymarker=[];
arraymarkerveh=[];