This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use bevy::app::{Plugin, App}; | |
use bevy::ecs::component::Component; | |
use bevy::ecs::event::{EventReader, EventWriter}; | |
use bevy::ecs::change_detection::ResMut; | |
use bevy::ecs::prelude::Res; | |
use bevy::log::info; | |
use bevy::prelude::{KeyCode, NodeBundle}; | |
use bevy::input::Input; | |
use bevy::ecs::system::{Commands, Query}; | |
use bevy::hierarchy::BuildChildren; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function fn_getTimeStamp(): Object { | |
// Create a date object with the current time | |
let now: Date = new Date(); | |
// Create an array with the current month, day and time | |
let date: Array<String> = [ String(now.getMonth() + 1), String(now.getDate()), String(now.getFullYear()) ]; | |
// Create an array with the current hour, minute and second | |
let time: Array<String> = [ String(now.getHours()), String(now.getMinutes())]; | |
// If seconds and minutes are less than 10, add a zero | |
for (let i of time) { | |
if ( Number(i) < 10 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//*** Initialize the countdown timer for all players | |
sv_currentTime = 5*60; | |
[ "itemAdd", [ | |
"countdownTimer", { | |
sv_currentTime = sv_currentTime - 1; | |
if (sv_currentTime isEqualTo 0) then { | |
sv_currentTime = nil; | |
"EveryoneLost" call BIS_fnc_endMissionServer; | |
}; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Example usage: | |
//if you have a bunch of triggers all with the prefix "trg_", then you can assemble them all into an array by saying: | |
//"trg_" call sxf_fnc_getEntitiesByPrefix; | |
sxf_fnc_getEntitiesByPrefix = { | |
_tempList = []; | |
_i = count _tempList; | |
while { _i = _i + 1; !isNil (_this + str _i) } do { | |
_tempList pushBack ( missionNamespace getVariable [(_this + str _i), objNull] ); | |
}; | |
_tempList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//*** Configure the aircraft rearm and refuel triggers (requires SERVERSIDE context only!) | |
sxf_fnc_stripAircraft = { | |
//_this must be the aircraft vehicle itself | |
{ | |
if (_x != "CMFlareLauncher") then //i don't know how to re-add this back into the chaff slot for some reason... :'c | |
{ | |
_this removeWeaponTurret [_x, [-1]]; | |
}; | |
} forEach (_this weaponsTurret [-1]); | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Assumed file path: mission-folder\tagus\fnc_whiteListArsenal.sqf | |
If you put the script file elsewhere, make sure you reference it correctly! | |
I spent 3 hours while working on this pulling my hair out because I wrote / instead of \ when calling the execVM. | |
I hate everything right now. | |
Syntax: | |
[object, boolean] execVM "tagus\fnc_whiteListTheArsenal.sqf"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
I found this randomly and wanted to save it for future reference. | |
Let a, b denote the numerator and denomator, respectively. Let 'gcd' denote the Greatest Common Divisor of both a and b. | |
=end | |
if(a==0 || b==0) | |
return gcd = 1; | |
else |