Skip to content

Instantly share code, notes, and snippets.

View headswe's full-sized avatar
🏀
Building cool things

Sebastian Nygren headswe

🏀
Building cool things
View GitHub Profile
@headswe
headswe / gist:7958249
Created December 14, 2013 11:44
Kept crashing arma 3 without any errors. straight CTD
class SpectStrText: spect_RscStructuredText
{
idc = 1310;
x = 0.341317 * safezoneW + safezoneX;
y = 0.283882 * safezoneH + safezoneY;
w = 0.317366 * safezoneW;
h = 0.375858 * safezoneH;
// text = "Hello this is a help window";
text = "<br /> Use the mouse or the WASD to control the camera, H to show and close the help window.<br /> Press M for the map.<br /> ";
};
@headswe
headswe / init.sqf
Last active August 29, 2015 14:04
Example of addaction and bis_fnc_mp
fnc_OnLaptopInteract = {
// send [], to function "fnc_mission_OnUseLaptop", false = to server, isPersistent = false
[[], "fnc_mission_OnUseLaptop", false, false] spawn BIS_fnc_MP; // launch a RPC to the server telling it to execute the function called "fnc_mission_OnUseLaptop"
};
fnc_mission_OnUseLaptop =
{
_countdown = 300;
MyNonPrivateValue = 5;
while{_countdown > 0 || !triggerActivated _trg} do // while count is under 300 and the trigger has not been activated keep counting
_rightHandPos = (player modelToWorld (player selectionPosition "righthand")) ;
_weaponDir = player weaponDirection currentWeapon player;
_weaponDir = (_weaponDir select 0) atan2 (_weaponDir select 1);
_x = (_rightHandPos select 0) + sin(_weaponDir) * 0.5;
_y = (_rightHandPos select 1) + cos(_weaponDir) * 0.5;
@headswe
headswe / csvdump.sqf
Last active August 29, 2015 14:06 — forked from harakka/csvdump.sqf
///////// XML EXPORT
///////// Usage: [name,CfgPatches name]
///////// Usage : [name] to export bis stuff
_CfgPatches = false;
_configPath = "";
_collectionName = "BIS";
if(count [] > 1) then
{
hlc_rifle_RU556 - AR15 Sanitied Carbine (Magpul AFG, MOE,P-Mag,BAD-lever. Novekse KX3)
hlc_rifle_RU5562 - AR15 Magpul Carbine (Magpul AFG, UBR,P-Mag,BAD-lever. Novekse KX3)
hlc_rifle_Colt727 - Colt Carbine (Colt Model 727 "Commando" - "M4" Barrel, M16A2 Upper, Full-Auto Lower)
hlc_rifle_Colt727_GL - Same as above, add M203
hlc_rifle_bcmjack - Bravo Company MFG/Haley Strategic 'Jack" Carbine ( Milspec M4 reciever, Geissele SMR Mk1, BCMGunfighter Muzzle brake/comp, there's more, but this isn't an advert)
hlc_rifle_Bushmaster300 - Busmaster .300 Carbine (M4A1-profile carbine chambered for .300 Blackout, instead of 5.56mm NATO)
hlc_rifle_vendimus - AR15 .300 Dissipator Carbine (Carbine-length heavy barrel covered by full-length rifle furniture)
hlc_rifle_SAMR - Rock River Arms LAR-15 AMR (Full-Auto-Capable full-length rifle, kitted out to be able to double as a marksman rifle, with accuracy to match)
hlc_rifle_honeybase - AAC 'Honey-Badger',Sans Suppressor
hlc_rifle_honeybadger - AAC 'Honey-Badger' (S
@headswe
headswe / gist:d658aa3714a0392cebf5
Last active August 29, 2015 14:19
Demand : Map
//Dictionary. Fast lookups are critical.
//Dictionaries provide fast lookups,based on keys,to get values. With them, we use keys and values of any type
// returns a new Dictionary handle
_map = createDictionary;
// dicthandle set [key,value];
_map set ["mypos",getpos player];
_map set [32,"threetwo"];
_map set ["friend",_otherPlayer];
@headswe
headswe / repo.xml
Last active February 13, 2016 10:37
<?xml version="1.0"?>
<AddonCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Name>YourName</Name>
<ServerAddress>MyGameServer.com</ServerAddress>
<ServerPort>1337</ServerPort>
<ServerPassword>MyPassword</ServerPassword>
<ForceBattleEye>False</ForceBattleEye>
</AddonCollection>
_getCluster = {
private ["_clusters","_checkedMen","_distanceMaX","_cluster","_unit"];
_clusters = [];
_checkedMen = [];
_distanceMaX = 35;
{
if(!(_x in _checkedMen)) then
{
_cluster = [_x];
_unit = _x;
params ["_pos","_radius","_side];
{_pos distance2d _x < _radius && {side _x == _side}} count allunits
#include "debug_console.hpp"
conClear();
_items = [];
#define TAB 9
#define BACKWARDSLASH 92
#define QUOTE 34
KK_fnc_insert = {
private ["_arr", "_i", "_res"];
_arr = _this select 0;
_i = _this select 2;