Skip to content

Instantly share code, notes, and snippets.

View commy2's full-sized avatar

commy2

View GitHub Profile
// initPlayerLocal.sqf
params ["_unit"];
commy_safezone_muzzles = getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles") + getArray (configFile >> "CfgWeapons" >> "Put" >> "muzzles");
commy_safezone_eachFrame = {
if (_this inArea "safezone") then {
{
_this setWeaponReloadingTime [_this, _x, 1];
} forEach commy_safezone_muzzles;
// 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";
# booleans
TRUE = lambda a: lambda b: a
FALSE = lambda a: lambda b: b
assert TRUE(1)(0) == True
assert FALSE(1)(0) == False
CBA_fnc_get3DENRotation = {
params ["_object"];
private _dir = vectorDir _object;
_dir params ["_xDir", "_yDir", "_zDir"];
private _up = vectorUp _object;
_up params ["_xUp", "_yUp", "_zUp"];
private _side = _dir vectorCrossProduct _up;

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)\
})
class Extended_DisplayLoad_EventHandlers {
class RscDisplayLoading {
Mission_customLoadingScreen = "_this call compile preprocessFileLineNumbers 'initLoadingScreen.sqf'";
};
};
params ["_display"];
private _background = _display ctrlCreate ["RscPicture", -1];
_background ctrlSetPosition [
safezoneXAbs,
safezoneY,
safezoneWAbs,
safezoneH
];
// 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