Posted: . At: 8:15 PM. This was 6 years ago. Post ID: 11915
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Code for Arma 3 to spawn you in a random jet with infinite ammo and refilling fuel.


This code will spawn you in a jet flying over the AO, this will pick a random jet and spawn you a long way up, so you will not crash before orienting yourself. Put this script in initPlayerLocal.sqf.

        private "_jet";
        _jet = createVehicle [selectRandom ["O_Plane_Fighter_02_Stealth_F", "I_Plane_Fighter_04_F", "B_Plane_Fighter_01_Stealth_F", "O_Plane_CAS_02_dynamicLoadout_F"], getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), [], random 18000, "FLY"];
 
        _jet setPos [getPos _jet select 0,getPos _jet select 1,6500];
        _jet setVelocity [(vectorDir _jet select 0)*100,(vectorDir _jet select 1)*100,(vectorDir _jet select 2)*100];
		_jet addeventhandler ["fired", {(_this select 0) setvehicleammo 1}];
		nul = this spawn { waitUntil { if !(alive _jet) exitWith {}; if (fuel _jet < 0.25) then { _this setFuel 1 }; sleep 6; false } };
 
        player moveInDriver _jet;

The script will work on any map, it will read the center position and then spawn you in a random location 6500 meters up.

Simple Arsenal script. Place a box named crat99, then put this code in initPlayerLocal.sqf.

BIS_holdActionSFX = (getArray (configFile >> "CfgSounds" >> "Orange_Action_Wheel" >> "sound")) param [0, ""];
BIS_holdActionSFX = BIS_holdActionSFX + ".wss";
BIS_holdActionProgress = 
{
	private _progressTick = _this select 4; 
	if ((_progressTick % 2) == 0) exitwith {}; 
 
	private _coef = _progressTick / 24; 
	playSound3D [BIS_holdActionSFX, player, false, getPosASL player, 1, 0.9 + 0.2 * _coef];
};
 
[crat99, "Open the Arsenal", "\A3\Ui_f\data\Logos\a_64_ca.paa", "\A3\Ui_f\data\Logos\a_64_ca.paa", "(_this distance _target < 6) && (isNull (findDisplay 162))", "isNull (findDisplay 162)", {}, BIS_holdActionProgress, {["Open",true] call BIS_fnc_arsenal;}, {}, [], 0.5, nil, false] call BIS_fnc_holdActionAdd;

Play random music, then greet the player. Put this code in initPlayerLocal.sqf.

0 fademusic 0.4;
//--- Play random music
_track = ["AmbientTrack01a_F_Tacops","AmbientTrack01b_F_Tacops","AmbientTrack02a_F_Tacops","AmbientTrack02b_F_Tacops","AmbientTrack03a_F_Tacops","AmbientTrack03b_F_Tacops","AmbientTrack04a_F_Tacops","AmbientTrack04b_F_Tacops","EventTrack01a_F_Tacops","Wasteland","Fallout","Defcon","MAD","SkyNet","Track08_Night_ambient","Track07_ActionDark","EventTrack01_F_Orange"] call BIS_fnc_selectRandom;
 
addmusiceventhandler [
	"MusicStop", {
		[str(worldName) , str(date select 1) + "." + str(date select 2) + "." + str(date select 0), str(groupId (group player))] spawn BIS_fnc_infoText;
		[WEST,"HQ"] sideChat format ["Hello %1, welcome to the server. You are in group: %2. You are playing: %3.", name player, str(groupId (group player)),str productVersion];
	}
];

Use these code snippets and then make a very good mission for yourself. These will really help with mission presentation.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.