Skip to content

Instantly share code, notes, and snippets.

View X39's full-sized avatar
Busy with reallife

Marco Silipo X39

Busy with reallife
View GitHub Profile
@X39
X39 / gist:f149ef35484d6466fc4b
Last active February 24, 2022 04:48
ArmA 3, Show Playernames with Ranks on HUD
if(!isDedicated && hasInterface) then
{
addMissionEventHandler ["Draw3D", {
{
if(side _x == playerSide) then
{
_dst = (_x distance player);
_size = 1 - (_dst / 100);
_pos = position _x;
_pos set[2, (_pos select 2) + 2.25];
@X39
X39 / foo.sqf
Created May 20, 2015 23:00
Return concept
foo = {
private["___returnValue___", "___returnedValue___"];
___returnedValue___ = _this call {
scopeName "___returnScope___";
//works only with topMost scope but not lower scopes
if(false) exitWith {false};
if(true) then
{
@X39
X39 / VehicleCrewDisplay
Last active August 29, 2015 14:23
VehicleCrewDisplay
/**
* @Param 1 - ACTION:
* STRING - String containing the action name, possible actions:
* - init
* - EH_KeyUp
* - EH_KeyDown
* - CreateDisplay
* - DestroyDisplay
* @Param 2 - PARAMETERS:
* ARRAY, see:
@X39
X39 / mutexExtensionDll.cpp
Created August 1, 2015 20:41
ArmA3 Mutex extension
#pragma once
#include <Windows.h>
#include <vector>
#include <mutex>
extern "C"
{
__declspec(dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function);
};
std::vector<std::mutex*> mutexList;
X39_fnc_Scheduler_Create = {
/*
* Creates the scheduler object if not yet was created
* Params: -/-
* Return: OBJECT - Scheduler object (also available via missionNamespace variable 'X39_var_Scheduler')
* Throws: No
* Notes : -/-
*/
if(!isNil "X39_var_Scheduler") exitWith {};
private "_scheduleFunction";
@X39
X39 / ExtractCfgToClipboard.sqf
Last active October 4, 2015 10:13
Prints ArmA Config class (+ its parents) to clipboard
//Example call:
//[configFile >> "CfgVehicles" >> "B_Soldier_F"] call _fnc_printClass;
_fnc_printClass = {
params [
"_class"
];
private [
"_fnc_getClass",
"_fnc_WriteToString",
"_classArr",
X39_fnc_genMissionUUID = {
///Generates a numbers only UUID
///Chance for duplicates is extremly low but not 100% terminated!
///Chance for duplicates can be further reduced by taking player
///UID into account (will prevent usage for servers)
private [
"_fnc_toNDigitsStringRandom",
"_parts"
];
_fnc_toNDigitsStringRandom = {
@X39
X39 / code.sqf
Created April 29, 2016 14:59
ArmA3 Draw Player Markers on HUD
if (!isNil "EH") then
{
removeMissionEventHandler ["Draw3D", EH];
};
EH = addMissionEventHandler ["Draw3D", {
_prefix = "_USER_DEFINED";
_prefixCount = count _prefix;
_cfgMarkers = configFile >> "CfgMarkers";
_cfgMarkerColors = configFile >> "CfgMarkerColors";
_FadeDistanceMax = [2000, 3000];
@X39
X39 / quiz.html
Created August 16, 2017 13:15
Quiz html "draft"
<html>
<head>
<style>
body {
}
.quiz {
width: 75%;
text-align: center;
margin: auto;
background: #929292;
@X39
X39 / sao.sqf
Created September 29, 2017 00:43
show allmission objects
if (!isNil "eh") then {removeMissionEventHandler ["Draw3D", eh];};
eh = addMissionEventHandler["Draw3D", {
{
private _pos = position _x;
drawLine3D [[(_pos select 0) - 1, (_pos select 1) - 1, (_pos select 2) - 1], [(_pos select 0) - 1, (_pos select 1) + 1, (_pos select 2) - 1], [1, 0, 0, 1]];
drawLine3D [[(_pos select 0) - 1, (_pos select 1) - 1, (_pos select 2) - 1], [(_pos select 0) - 1, (_pos select 1) - 1, (_pos select 2) + 1], [1, 0, 0, 1]];
drawLine3D [[(_pos select 0) - 1, (_pos select 1) - 1, (_pos select 2) - 1], [(_pos select 0) + 1, (_pos select 1) - 1, (_pos select 2) - 1], [1, 0, 0, 1]];
drawLine3D [[(_pos select 0) + 1, (_pos select 1) + 1, (_pos select 2) + 1], [(_pos select 0) + 1, (_pos select 1) - 1, (_pos select 2) + 1], [1, 0, 0, 1]];
drawLine3D [[(_pos select 0) + 1, (_pos select 1) + 1, (_pos select 2) + 1], [(_pos select 0) - 1, (_pos select 1) + 1, (_pos select 2) + 1], [1, 0, 0, 1]];