Skip to content

Instantly share code, notes, and snippets.

View SamJUK's full-sized avatar

Sam James SamJUK

View GitHub Profile
[]spawn{
private ["_ServerName","_ChannelName","_TSPluginEnabled"];
sleep 15;
while {true} do {
_Error = false;
_ServerName = call TFAR_fnc_getTeamSpeakServerName;
_ChannelName = call TFAR_fnc_getTeamSpeakChannelName;
_TSPluginEnabled = call TFAR_fnc_isTeamSpeakPluginEnabled;;
_AdminState = (life_adminlvl > 0);
_WhiteListedChannels = ["InGameA3"];
@SamJUK
SamJUK / TP || Move Upwards
Created October 30, 2016 21:53
Arma 3 Code Snippets
Sam_TPUpwards={
//Sets you 3m above current height
player setPos(player modelToWorld[0, 0, 3]);
};
_dist = 10
player setPosATL [(getPosATL player) select 0 + _dist * sin(getDir player),(getPosATL player) select 1 + _dist * cos(getDir player),0];
/*
1ST var = Classname
Returns: "Uniform"||"Vest"||"Bag"||False
*/
Life_Fnc_ClothingType = {
_t = false;
_configParents = [(configFile >> "CfgWeapons" >> (_this select 0),true ] call BIS_fnc_returnParents;
if ("Uniform_Base" in _configParents)then {_t = "Uniform"};
if ("Vest_Camo_Base" in _configParents)then {_t = "Vest"};
if ("Bag_Base" in _configParents)then {_t = "Bag"};
@SamJUK
SamJUK / whatever.sqf
Created November 2, 2016 23:48
Arma 3 Knockout from behind condition
//Returns: True if behind or False if not directly behind an alive player with a weapon out
player distance (cursorObject modelToWorld [0,-3,0]) < 3 && !isNull cursorObject && cursorObject isKindOf "Man" && !isPlayer cursorObject && alive cursorObject && currentWeapon player != ""
@SamJUK
SamJUK / Armaystuff.sqf
Created November 2, 2016 23:58
Disable Knockout in combat
//Function to spawn on FIRE event handler
Sam_InCombat = {
//Sets player variable "In_Combat" to true for 15 seconds for every player and AI within 15Ms
_array = (nearestObjects [player, ["Man"], 15]) - [player];
{_x setVariable ["In_Combat", true, true]}forEach _array;
uisleep 15;
{_x setVariable ["In_Combat", false, true]} forEach _array;
};
//Add to condition statement
@SamJUK
SamJUK / Tow.sqf
Last active November 3, 2016 17:26
Updated A3L__TowTruck's Tow script | Addd ATM safezone check, Alive player check, moving chekcs etc
/*
File: Tow.sqf
Author: Caiden
Description:
Main handler for attempting to tow/untow a vehicle
*/
_veh = _this;
_isTowing = _veh getVariable "isTowing";
@SamJUK
SamJUK / fn_MassSpawn.sqf
Created November 16, 2016 12:42
ArmA 3 Mass Vehicle Spawn
/*
Spawn Vehicle Script
PARAMETERS:
Vehicle(s): Classname | Single Array | Multi Dimentional Array
Total: Int
Row: Int
Return: None
["A3L_Towtruck",50,10]call sam_fnc_MassSpawn; | Spawn 5 rows of 10 tow trucks facing north totaling to 50 trucks
@SamJUK
SamJUK / asd.sqf
Created December 9, 2016 09:03
asd.sqf
{
["ace_unconscious", {
_Unit = _this select 0;
_State = _this select 1;
if (_State){
//Unconcious?
_marker = createMarker ["Unconcious Friendly", getPos _Unit];
_marker setMarkerShape "ICON";
_marker setMarkerType "hd_dot";
}else{
@SamJUK
SamJUK / pwned.php
Created July 2, 2018 21:02
Check how many times a password has been pwned according the the pwnedpasswords.com API without sending the password over the network. Based from https://github.com/detroitenglish/haveibeenpwned-zxcvbn-lambda-api
<?php
/**
* Check how many times a password has been pwned
* according the the pwnedpasswords.com API
* without sending the password over the network
*
* @param String $password
* @return Int
*/