Jump to content

Base dome compromise


Recommended Posts

I know of dome base scripts and a lot of people do use them to protect bases. The majority of them are active all the time. I was playing around with a few scipts and was trying to combine some together to create a middle agreement with the players on my server. 

 

The problem I have is that players wait till your offline and go and destroy bases. So I saw the post on opendayz.net about the dome protection. For the life of me I can't seem to get it working. 

 

This script is set to work only when the said player is offline. That meaning someone can attack the base when the player is online. GREAT IDEA...

 

I think maybe the scripting is out dated and maybe not suited for epoch the triggering works when leaving the area so the trigger is there. Just the script isn't running when entering the base. I have next to no knowledge in writing scripts I go from the community.  

 

So I ask if some smart scripter can work something to get a dome script to only work when a player is offline. 

/*
Created by:
	Dami
*/
if (local player) then 
{
	_baseMARKER = "Admin Base";
	_basePUIDs =
	[
		"117524806","PIDS","HERE",
		"LIKE","THIS"
	];
	//Setup completed, don't touch anything underneath, unless you are.. cake.
	//No, seriously. Don't touch anything else.
	counted_players = 0;
	online_check_k = false;
	_countthem = (({isplayer _x} count (getPos vehicle player nearObjects ['CAManBase',90000])));
	_countthem2 = (getPosATL player) nearObjects ["CAManBase", 90000];
	{
		if (isPlayer _x) then
		{
			if (getPlayerUID _x in _basePUIDs) then
			{
				counted_players = counted_players + 100;
			};
			counted_players= counted_players + 1;
		};
	} forEach _countthem2;
	if (counted_players > _countthem) then
	{
		online_check_k = true;
	};
	if (online_check_k) exitWith {};
	_zonevariable = "GetOut_" + _baseMARKER;
	if (getPlayerUID player in _basePUIDs) exitWith
	{
		cutText [format ["Welcome back to base, %1!",name player],"PLAIN DOWN"];
		systemChat ("Welcome back to base, "+name player+"");
	};
	call compile
	('
	if !(getPlayerUID player in _basePUIDs) then
	{
		_servervelocity = velocity (vehicle player);
		infantry_teleportdami =
		{
			_baseMARKER = _this select 0;
			_dir = random 359;
			(vehicle player) SetPos [(getMarkerPos _baseMARKER select 0),(getMarkerPos _baseMARKER select 1)];
			(vehicle player) setDir _dir;
		};
		helicopter_teleportdami =
		{
			_baseMARKER = _this select 0;
			_dir = getDir (vehicle player);
			_curpos = getMarkerPos _baseMARKER;_curtime = time;player setVariable ["damipos337", _curpos];player setVariable ["damitime337", _curtime];(vehicle player) SetPos [(getMarkerPos _baseMARKER select 0),(getMarkerPos _baseMARKER select 1),200];
			(vehicle player) setDir _dir;
		};
		plane_teleportdami =
		{
			_baseMARKER = _this select 0;
			_inAN2 = _this select 1;
			_inMV22 = _this select 2;
			if ((_inAN2) || (_inMV22)) then
			{
				_dir = getDir (vehicle player);
				_curpos = getMarkerPos _baseMARKER;_curtime = time;player setVariable ["damipos337", _curpos];player setVariable ["damitime337", _curtime];(vehicle player) SetPos [(getMarkerPos _baseMARKER select 0),(getMarkerPos _baseMARKER select 1),200];
				(vehicle player) setDir _dir;
				sleep 1;
				(vehicle player) setVelocity [(_servervelocity select 0)+1*sin(_dir), (_servervelocity select 1)+1*cos(_dir)];
			};
		};
		if (isNil "'+_zonevariable+'") then
		{
			[60,60] call fnc_usec_pitchWhine;
			[60,1] call fnc_usec_pitchWhine;
			'+_zonevariable+' = 0;
			cutText ["ACCESS DENIED! Please leave or your legs will be broken.","PLAIN"];
			systemChat ("ACCESS DENIED! Please leave or your legs will be broken.");
		} else {'+_zonevariable+' = '+_zonevariable+' + 1;};
		if ('+_zonevariable+' == 1) then
		{
			_unit = player;
			_selection = "legs";
			_damage = 1;
			_unit setHit[_selection,_damage];
			cutText ["ACCESS DENIED! Please leave or you will be killed.","PLAIN"];
			systemChat ("ACCESS DENIED! Please leave or you will be killed.");
		};
		if ('+_zonevariable+' >= 2) then
		{
			cutText ["We warned you...","PLAIN DOWN"];
			systemChat ("We warned you...");
			sleep 0.5;
			[60,60] call fnc_usec_pitchWhine;
			[60,1] call fnc_usec_pitchWhine;
			_dir = getdir (vehicle player);
			_vel = velocity (vehicle player);
			(vehicle player) setVelocity [(_vel select 0)+5*250*sin(_dir),(_vel select 1)+5*250*cos(_dir),(150)];
			sleep 1.8;
			if (alive player) then {(vehicle player) SetDamage 1.19;};
			[] spawn player_death;
			'+_zonevariable+' = 0;
		};
		_inAN2 = vehicle player isKindOf "AN2_DZ";
		_inMV22 = vehicle player isKindOf "MV22";
		if (vehicle player isKindOf "Air") then
		{
			if ((!_inAN2) || (!_inMV22)) then {[_baseMARKER] spawn helicopter_teleportdami;} else {[_baseMARKER,_inAN2,_inMV22] spawn plane_teleportdami;};
		} else {[_baseMARKER] spawn infantry_teleportdami;};
	};
	');
};

This is the script in which it is said to check if player is online just doesn't work for me. 

 

Sorry for being a pain....

 

William

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...