Some more Arma 3 script samples.

Posted: October 6, 2017. At: 10:15 AM. This was 2 weeks ago. Post ID: 11436

Very useful Arma 3 scripting samples

This scripting sample will remove the solar panels and doors from the Orange DLC tents and make them look like a good old fashioned MASH tent.

med1 animateSource ["MedSign_Hide",1,true];
med1 animateSource ["Door_Hide",1,true];
med1 setObjectTextureGlobal [0,"\A3\Structures_F_Orange\Humanitarian\Camps\Data\MedicalTent_01_tropic_F_CO.paa"];

Add this code to your initServer.sqf file. This will run a function that will automatically draw markers for minefields on the map.

[] spawn bis_fnc_drawMinefields;

This code in your initServer.sqf will make all buildings around your base indestructible in a 1900m radius. This will help protect your base from trolls.

{ _x allowdamage false; } foreach (nearestTerrainObjects [logic1,["house"],1900]);

Disable autohover. This code added to the init.sqf will disable autohover. Any time a player turns on autohover, it will be turned off again.

["disableAutohover",                        // unique name
"onEachFrame",                              // which kind of handler to attach
{                                           // the code follows here
    _vehicle = vehicle player;
    if(isAutoHoverOn _vehicle)
    then
    {
           player action ["autoHoverCancel", _vehicle];
    }
}] call BIS_fnc_addStackedEventHandler; // arguments to pass to the code

These code samples will make your missions even better. They are very helpful, especially the code to make buildings invincible. This stops trolls blowing everything up.

IFF script for Arma 3. Put this in the init.sqf and it will put markers over the heads of friendly and civilian AI and players. This will help prevent teamkilling.

[] spawn {
    ["FriendlyHUD", "onEachFrame", {
        _target = cursorTarget;
        _isFriendly = if ( ( (side player) getFriend (side _target) ) > 0.6 ) then {true} else {false};
        if (alive _target && _isFriendly && (_target isKindOf "Man") && (player distance _target) <= 900) then {
            _markerPath = (configFile >> "CfgMarkers" >> "b_inf" >> "icon") call BIS_fnc_getCfgData;
            _configColor = (configFile >> "CfgMarkerColors" >> (format["Color%1", (side _target)]) >> "color") call BIS_fnc_getCfgData;
            _color = _configColor call BIS_fnc_colorConfigToRGBA;
            _pos = _target modelToWorld (_target selectionPosition "head_axis");
            drawIcon3D [_markerPath, _color, [_pos select 0, _pos select 1, (_pos select 2) + 0.5], 1, 1, 0, (name _target), 0];
        };
    }] call BIS_fnc_addStackedEventHandler;
};

No comments have been made. Use this form to start the conversation :)

Leave a Reply