Skip to content

Instantly share code, notes, and snippets.

View commy2's full-sized avatar

commy2

View GitHub Profile
# booleans
TRUE = lambda a: lambda b: a
FALSE = lambda a: lambda b: b
assert TRUE(1)(0) == True
assert FALSE(1)(0) == False
// init.sqf
#define TEXT_REPAIR "Repair Sensor"
#define ICON_REPAIR "\a3\ui_f\data\igui\cfg\simpletasks\types\repair_ca.paa"
#define REPAIR_TIME 5
private _toolkit = configName (configFile >> "CfgWeapons" >> "ToolKit");
["Mission_Repaired", {
params ["_unit", "_target", "_toolkit", "_canRepair"];
hint "REPAIR DONE";

rfind

#define RFIND(h,n) (call {\
    private _offset = count (h) - count (n);\
    private _index = _offset - (reverse (h) find reverse (n));\
    [_index, -1] select (_index > _offset)\
})
// description.ext
class Extended_DisplayLoad_EventHandlers {
class RscDisplayAVTerminal {
Mission = "'Mission_UAVTerminalOpened' call CBA_fnc_localEvent";
};
};
// init.sqf
Mission_isUAVControlTaken = false;
{
private _pairs = [
[PunktEins, "wpPunkt11"],
[PunktZwei, "wpPunkt21"],
[PunktDrei, "wpPunkt22"],
[PunktVier, "wpPunkt31"],
[PunktFuenf, "wpPunkt32"],
[PunktSechs, "wpPunkt33"],
[PunktSieben, "wpPunkt34"],
[PunktAcht, "wpPunkt41"],
[PunktNeun, "wpPunkt42"],
/*
init.sqf
Trigger: PuEiSta
*/
if (isServer) then {
0 spawn {
waitUntil {
waitUntil {
// Transition to "Blue controlled" state
// description.ext
class CfgFunctions {
#include "CfgFunctions.hpp"
#include "KP\KPPLM\KPPLM_functions.hpp"
class SAF {
#define SAF_FNCS
#include "sushi_scripts\core\init.cpp"
#include "sushi_scripts\breach\init.cpp"
#undef SAF_FNCS
// init.sqf
["weaponMode", {
params ["_unit", "_newWeaponMode", "_oldWeaponMode"];
private _weapon = currentMuzzle _unit;
if (_newWeaponMode != "Single") then {
private _weapons = ["arifle_MX_F", "hlc_rifle_CQBR"];
private _cfgWeapons = configFile >> "CfgWeapons";
if (_weapons findIf {_weapon isKindOf [_x, _cfgWeapons]} != -1) then {
// init.sqf
["weaponMode", {
params ["_unit", "_newWeaponMode", "_oldWeaponMode"];
private _weapon = currentMuzzle _unit;
if (_weapon isKindOf ["hlc_rifle_CQBR", configFile >> "CfgWeapons"] && _newWeaponMode != "Single") then {
[_unit, _weapon, "Single"] call CBA_fnc_selectWeapon;
};
}, true] call CBA_fnc_addPlayerEventHandler;

forAny

∃xC(x)

private _array = [1,2,3,4,5];
private _condition = {_x > 10};

_array findIf _condition != -1

"There is some X in _array such that X > 10."