Skip to content

Instantly share code, notes, and snippets.

View GeorgeDettmer's full-sized avatar

George GeorgeDettmer

  • Leicester, United Kingdom
View GitHub Profile
@GeorgeDettmer
GeorgeDettmer / fn_preInit.sqf
Created October 11, 2017 23:12
See m8 I am re-writing it all AGAIN 2k20 here we cum
private _startTime = diag_tickTime;
survive_server_fnc_log = compileFinal preprocessFileLineNumbers "survive_server\functions\server\log.sqf";
"Beginning function compile..." call SURVIVE_server_fnc_log;
private _totalFunctionsDefined = 0;
{
private _functionTarget = _x;
private _totalFunctionsOfTargetDefined = 0;
this setVariable ["anims",["anim1","anim2"]];
this setVariable ["loopEh",
this addEventHandler ["AnimDone",{
if (param[0] getVariable ["anims",[]] isEqualTo []) then {
param[0] removeEventHandler ["AnimDone",param[0] getVariable "loopEh"];
};
param[0] playMove (param[0] getVariable ["anims",[]] deleteAt 0);
}]
];
this playMove (this getVariable ["anims",[]] deleteAt 0);
class TentLarge_Pitched : FixedContainer {
scope = public;
displayName = "Big Military Tent";
descriptionShort = "Big military tent, can house a small unit including their equipment.";
model = "\DZ\gear\camping\large_tent.p3d";
inventoryCondition = "false";
openable = 0;
itemSize[] = {2, 6};
itemsCargoSize[] = {6, 42};
itemsCargo[] = {};
cursorObject spawn {
diag_log ("#################################################################################################################################" + typeOf _this);
_box = boundingBoxReal _this;
{
_sel = []; _nsel = [];
for "_i"
from (_box select 0 select 2)
to (_box select 1 select 2)
step 0.1 do {
for "_j"
class CfgPatches {
class DZ_Structures_Houses {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"DZ_Structures","DZ_Structures_Furniture","A3_Data_F","A3_Structures_F","A3_Structures_F_Dominants","CAData","CABuildings","CABuildings2","CAStructures","CAStructures_e","CAMisc","CAMisc2","CAMisc3","CARoads","CARoads2","CARoads_e"};
};
};
[targetGroup,delay,yourGroup] spawn {
followWaypoint = param[2,group player] addWaypoint [param[0,grpNull,[grpNull]]];
while {TRUE} do {
uiSleep param[1,5,[0]]
param[2,group player] addWaypoint [param[0,grpNull,[grpNull]],followWaypoint];
};
};
#define CRATE_CLASSNAME "crate_classname_here"
#define CRATE_HEIGHT 100
#define CRATE_DISTANCE 15
#define CRATE_DIRECTION 0
#define MARKER_NAME "crate"
#define MARKER_ICON "hd_dot"
player addAction [
"Spawn crate",
{
waitUntil {
time > 0 &&
!isNull player &&
player == player
};
if param[1] then {
["Initialize", [player, [side player], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
SETLOCAL ENABLEEXTENSIONS
:v64_path_a2
For /F "Tokens=2* skip=2" %%A In ('REG QUERY "HKLM\SOFTWARE\Wow6432Node\Bohemia Interactive Studio\ArmA 2" /v "MAIN"') Do (set _ARMA2PATH=%%B)
IF NOT DEFINED _ARMA2PATH (GOTO v32_path_a2) ELSE (GOTO v64_path_a2oa)
:v32_path_a2
For /F "Tokens=2* skip=2" %%C In ('REG QUERY "HKLM\SOFTWARE\Bohemia Interactive Studio\ArmA 2" /v "MAIN"') Do (set _ARMA2PATH=%%D)
addMissionEventHandler ["Draw3D", {
{
if (side _x == playerSide && {_x distance player < viewDistance}) then {
drawIcon3D [
'',
getArray(configFile >> "CfgInGameUI" >> "SideColors" >> "colorFriendly"),
[
visiblePosition _x select 0,
visiblePosition _x select 1,
(visiblePosition _x select 2) +