Jump to content
jakeplissken

[Script release]. Nice anti trolling script for your bases.

Recommended Posts

This script will protect your base from trolls. All projectiles fired within the base, and fired into it from outside will be deleted. This will help greatly with reducing trolling and griefing on public servers.

 

player addEventHandler ["FiredMan", {
	params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
	firingman = _unit;
	weapongun = _weapon;

	_p = _this select 6;
	if(
		_p distance [4290.06,18054.5,0] < 300) then {
				[WEST,"HQ"] sideChat format ["Damn, %1 is firing a %2 at base. He should stop right now.", name _unit, str((configfile >> "CfgWeapons" >> _weapon >> "displayName") call BIS_fnc_GetCfgData)];
			    deleteVehicle _p;
	} else {
		_p spawn {
			waitUntil {
				if(
					_this distance [4290.06,18054.5,0] < 300 )then {
						[WEST,"HQ"] sideChat format ["Damn, %1 is firing a %2 into base from outside. He should stop right now.", name firingman, str((configfile >> "CfgWeapons" >> weapongun >> "displayName") call BIS_fnc_GetCfgData)];
						deleteVehicle _this;
				};
				if ( isNull _this ) exitWith { true };
				false
			};
		};
	};
}];

 

This is the position of the center of your base.: [4290.06,18054.5,0]. Just place an object and right-click, then log position to clipboard. Then edit the parts of the script that define the position to protect. But this really does work very well. It stops bombs, bullets and rockets fired at the base from outside and within. Put this in the initPlayerLocal.sqf and this will stop annoying public server teamkillers at base at least.

Edited by jakeplissken
Updated script as I made a booboo. Now it is much better.
  • Like 3

Share this post


Link to post
Share on other sites

I assume this must be run locally? Can imagine the load it would put on a dedicated public server... 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×