Skip to content

Instantly share code, notes, and snippets.

View commy2's full-sized avatar

commy2

View GitHub Profile
this addEventHandler ["killed", {_this call commy_fnc_moveOffRoad}];
// init.sqf
commy_fnc_moveOffRoad = {
#define DISTANCE_TO_MOVE 10
params ["_wreck"];
private _road0 = roadAt _wreck;
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
if (_activated) then {
//--- Terminate when not created on the server
if (!isserver && local _logic && isnull (getassignedcuratorunit _logic)) exitwith {
[format ["%1 is trying to create curator logic ModuleCurator_F",profilename],"bis_fnc_error",false] call bis_fnc_mp;
deletevehicle _logic;
/*
Author: Karel Moricky
Description:
Splendid arsenal viewer
Parameter(s):
0: STRING - mode
1: ANY - params (see below)
#define NEWLINE toString [13,10]
private _file = "file.txt";
private _delta = 0;
private _fnc_convert = {
private _result = 0;
private _digits = _this splitString ":";
reverse _digits;
#define DLC_APEX 395180
commy_allTanoaMarkers = [];
addMissionEventHandler ["Map", {
params ["_isOpened"];
if (_isOpened) then {
private _tanoaObjects = allMissionObjects "" select {getObjectDLC _x isEqualTo DLC_APEX};
commy_fnc_nearest = {
params ["_origin", "_objects"];
private _distances = _objects apply {_x distanceSqr _origin};
_objects select (_distances find selectMin _distances)
};
//init.sqf
{
_x addEventHandler ["CuratorObjectEdited", {
params ["", "_object"];
if (!local _object) then {
[_object, getDir _object] remoteExec ["setDir", _object];
};
}];
} forEach allCurators;
private _allAddons = "true" configClasses (configFile >> "CfgPatches") apply {configName _x};
// existing curators (has to run on server)
{
_x addCuratorAddons _allAddons;
} forEach allCurators;
// all future curators created via createUnit (has to run on all machines)
activateAddons _allAddons;
private _filter = ["NameCityCapital", "NameCity", "NameVillage"];
private _names = configProperties [configFile >> "CfgWorlds" >> worldName >> "Names", "isClass _x"];
// filter out all non-cities
_names = _names select {getText (_x >> "type") in _filter};
// convert array of configs into array of classnames
_names = _names apply {configName _x};
_names
My_Draw_PFH = objNull;
addMissionEventHandler ["MapSingleClick", {
if (isNull My_Draw_PFH) then {
params ["", "_pos"];
My_Draw_PFH = [
{
private _pos1 = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld getMousePosition;