This code will play music from a Radio in Arma 3.
fnc_radio = compileFInal preprocessfilelinenumbers "a3\missions_f_exp\Campaign\Missions\EXP_m01.Tanoa\functions\fn_EXP_m01_radioMusic.sqf"; [radio1] call fnc_radio; |
Just place a radio item and name it radio1, then put the code above in your initPlayerServer.sqf file. This allows a radio to play music. Once a track finishes, it will move to the next one. Great for ambiance.
Use this code to light up a position with bright daylight, this is good to light up your base and provide some nice lighting for night missions.
_pos = [4008.65,10287.6,72.5257]; _light = "#lightpoint" createvehiclelocal _pos; _light setposatl [_pos select 0,_pos select 1,(_pos select 2) + 10]; _light setLightDayLight true; _light setLightBrightness 20; _light setLightAmbient [0.05, 0.05, 0.1]; _light setlightcolor [1, 1, 2]; |
This code placed in the initServer.sqf will provide dynamic AI skill, this means the difficulty of the AI will scale depending upon how many people are playing the mission.
[ true, [ [EAST, 0.5, 0.2, 0.8, 0.3],[RESISTANCE, 0.3, 0.1, 0.5, 0.2]]] call BIS_fnc_exp_camp_dynamicAISkill; |
This is a nice way to have a mission that is more playable for lower player counts but can scale when a lot of people join it.
This code will delete a player’s body and their stuff when they disconnect from the server. Put it in the initServer.sqf file and this will work.
1 2 3 4 5 6 7 | handleDisconnect = { _unit = _this select 0; _containers = nearestObjects[_unit,["WeaponHolderSimulated"],6]; {deleteVehicle _x;} foreach _containers; deleteVehicle _unit; }; addMissionEventHandler ["HandleDisconnect",{_this call handleDisconnect; false}]; |