Posted: . At: 9:09 AM. This was 6 years ago. Post ID: 12080
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.


Very evil and cool Arma 3 script snippets.


Spawn a bomb wherever the player clicks on the map.

onMapSingleClick "'Bomb_03_F' createVehicle _pos,TRUE";

Attach a KAB-250 bomb to every bullet you fire, this also gives you unlimited ammo. Very destructive script for any malicious Arma 3 player.

player addEventHandler ["Fired", {
	("Bomb_03_F" createVehicle [0,0,1e9]) attachTo [_this select 6, [0,0,0]];
	(_this select 0) setvehicleammo 1;
}];

Remove stamina and also reapply these settings on respawn. Very useful for a multiplayer server.

player enablestamina false;
player setCustomAimCoef 0.35;
player setUnitRecoilCoefficient 0.75;
player setUnitTrait ['loadCoef',-900];
 
player setUnitTrait ["camouflageCoef",1];
 
player addEventHandler ['HandleRating',{
	(_this select 0) addRating (0 - (rating (_this select 0)));
}];
 
player addEventHandler ["Respawn", {
	player enablestamina false;
	player setCustomAimCoef 0.35;
	player setUnitRecoilCoefficient 0.75;
	player setUnitTrait ['loadCoef',-900];
 
	player setUnitTrait ["camouflageCoef",1];
	player addEventHandler ['HandleRating',{
		(_this select 0) addRating (0 - (rating (_this select 0)));
	}];
}];

How to use the debug console in Arma 3 to spawn a tank in front of the player.

testspawn = createVehicle ["O_MBT_04_command_F",getPos player,[], 0, "can_collide"];

This code placed in the initServer.sqf file will create a position on the map, spawn an object and then create a patrol around it. This could be used as a base to build a simple mission.

_gamelogic = CENTER;
_towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; 
_RandomTownPosition = position (_towns select (floor (random (count _towns))));
 
_m = createMarker [format ["mrk%1",random 100000],_RandomTownPosition];
_m setMarkerShape "ELLIPSE";
_m setMarkerSize [900,900];
_m setMarkerBrush "BDiagonal";
_m setMarkerAlpha 0.0;
_m setMarkerColor "ColorGUER";
 
_pos = getMarkerPos _m;
 
_randPos = [_pos, 25, 35, 10, 0, 0.5, 0] call BIS_fnc_findSafePos;
 
_cargo = "Land_BakedBeans_F" createVehicle _randPos;
_cargo setVehicleVarName "man1"; man1 = _cargo;
 
_markerstr = createMarker ["AO", _randPos];
_markerstr setMarkerShape "ICON";
_markerstr setMarkerType "hd_objective";
_markerstr setMarkerColor "ColorOPFOR";
 
_hqdef2 = _cargo getRelPos [-96, 256];
 
_group = [_hqdef2, RESISTANCE, (configfile >> "CfgGroups" >> "Indep" >> "IND_C_F" >> "Infantry" >> "ParaCombatGroup")] call BIS_fnc_spawnGroup;
[_group, getPos man1, 300] call bis_fnc_taskPatrol;

4 thoughts on “Very evil and cool Arma 3 script snippets.”

    • Yes, you can fire GAU-8 rounds from a rifle.

      player addEventHandler ["Fired", {
      	("Gatling_30mm_HE_Plane_CAS_01_F" createVehicle [0,0,1e9]) attachTo [_this select 6, [0,0,0]];
      	(_this select 0) setvehicleammo 1;
      }];

      And fire HE rockets as well.

      player addEventHandler ["Fired", {
      	("Rocket_04_AP_F" createVehicle [0,0,1e9]) attachTo [_this select 6, [0,0,0]];
      	(_this select 0) setvehicleammo 1;
      }];

      You can even fire .50 caliber rounds from a LSW like the Spar 16s.

      player addEventHandler ["Fired", {
      	("B_127x108_Ball" createVehicle [0,0,1e9]) attachTo [_this select 6, [0,0,0]];
      	(_this select 0) setvehicleammo 1;
      }];
      Reply

Leave a Comment

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