Jump to content

[Release] Base Anti Kamikaze


Recommended Posts

So we had a few issues with players doing kamikaze into other players bases and we got fed up with it since it made players leave our servers. So i came up with a really simple solution to it.

 

It works by setting triggers at plot poles  with a radius of 50 meters and a height test of min 3 meters and max 65 meters from the ground and speeds above 130.

 

you can tweak this to what you like.

I'm not saying this is the best way to do this but it works fine on our server

 

So it will TP Air vehicles away from the base it's trying to crash into, based on the parameters you set (minimum height and maximum height from ground and air vehicle speed.

 

Just so all are aware, this is no longer in use as the triggers are created on all clients and should be server side only! It is kept only for reference purpose and should not be used as posted below!

 

If you still want to use it, instead of "in your init.sqf inside the "if (!isDedicated) then {" scope, add this:"  Then do "in your init.sqf inside the "if (isServer) then {" scope, add this:" but i have NOT tested it

 

Installation:

Create a file called "AntiKamikaze.sqf" in your scripts folder in the root of your mission file.

and then insert this:

diag_log "Loading Anti Kamikaze...";

_centerOfMap = [7200,7200,0];
_triggerRadius = 50;
_AKplotPole = nearestObjects [_centerOfMap, ["Plastic_Pole_EP1_DZ"], 14500];

AK_fnc_GG = {
    if ((vehicle player) isKindOf "Air") then {
        _v = vehicle player;
        _speed = speed _v;
        _coordsVeh = getPos _v;
        _altitude = _coordsVeh select 2;
        if (_altitude > 3.0 && _altitude < 65.0 && _speed >= 130) then { //This is where you define the trigger altitude and speed
            _newPos = [_coordsVeh, 150, 300, 10, 0, 20, 0] call BIS_fnc_findSafePos;
            _newPos set [2, 400];
            _v setpos _newPos;
            titleText ["Really!?...what are you... like 4 years old??? Don't kamikaze! (If you try to land fly slower!)", "PLAIN", 3];
        };
    };
};

{
    _trg=createTrigger["EmptyDetector",getPos _x];
    _trg setTriggerArea[_triggerRadius, _triggerRadius, 0,false];
    _trg setTriggerActivation["WEST","PRESENT",true];
    _trg setTriggerStatements["(vehicle player) in thisList", "call AK_fnc_GG", ""];
    _trg setTriggerType "SWITCH";
    diag_log format["GEEKTEST: Creating Trigger @ %1",getPos _x];
} forEach _AKplotPole;

diag_log "...Anti Kamikaze Loaded!";

Remember to change center of the map coords if you don't use chenarus map

 

in your init.sqf inside the "if (!isDedicated) then {" scope, add this:

//Anti Kamikaze
[] execVM "Scripts\AntiKamikaze.sqf"

Please do comment if you know a better way to do it, or if you know of a way to make a sphere around each plot pole instead of a cylinder, just so i can get rid of the height check.

 

Please like if you use it :)

Link to comment
Share on other sites

the root issue is that we allow base raids, and then some players just don't care how much it costs, they just want to get back at those they think raided them, and then they kamikaze into the players base that they think raided them (some clans on our server like to raid the same players over and over). And i don't see that raiding a players base is a problem as we have rules implemented and enforced about what is allowed when you raid a base. but some victims still get so angry that they do this kind of stupidity.

Link to comment
Share on other sites

waituntil {!isnull (finddisplay 46)};
diag_log "Loading Anti Kamikaze...";

_centerOfMap = [7100,7750,0];
_triggerRadiusPlot = 50;
_AKplotPole = nearestObjects [_centerOfMap, ["Plastic_Pole_EP1_DZ"], 10500];

AK_fnc_GG = {
  if ((vehicle player) isKindOf "Man") then {
    _v = vehicle player;
    _coordsVeh = getPos _v;
    _newPos = [_coordsVeh, 150, 300, 10, 0, 20, 0] call BIS_fnc_findSafePos;
    _v setpos _newPos;
    titleText ["PUT YOUR TEXT HERE", "PLAIN", 3];
    };
  };
};

{
  _trg=createTrigger["EmptyDetector",getPos _x];
  _trg setTriggerArea[_triggerRadiusPlot , _triggerRadiusPlot , 0,false];
  _trg setTriggerActivation["WEST","PRESENT",true];
  _trg setTriggerStatements["(vehicle player) in thisList", "call AK_fnc_GG", ""];
  _trg setTriggerType "SWITCH";
} forEach _AKplotPole;

diag_log "...Anti Kamikaze Loaded!";

just remember this will not knockout your target but you can just add knocout code to the function if you want it. also remember it will do this to every plot pole on the server

 

(Code above is untested but should work)

Link to comment
Share on other sites

For some weird reason its not working.

The code seems right, and the script is loading....but i am not getting TPd when i try to crash a chopper right on top of the pole, with > 130 speed.

I just crash....I have Godmode on but i dont think that matters.

Plot pole is at coordinates: [54.554,[3268,8807.62,0.064]]    so its not that its off the map or anything.

Really weird.

Link to comment
Share on other sites

Awesome script + idea. Just looking at this, wouldn't people just be able to get to a speed of say 50 or something which is underneath the variable and kamikaze still. If you set the variable too low, the landing thing wouldn't work, because it'd be impossible to land near a base. This is because if you put the variable at 50, you'd find it hard to land because you'd be stalling out if you were going under 50 depending on what type of angle you were trying to land at. If you set the variable too high, you'd have people going under the set speed to kamikaze. That's the only "kink" I've found in it, but overall, great script. I haven't actually tested this out yet, so if I am wrong, please don't kill me :P

Link to comment
Share on other sites

well you are correct, but most players who are kamikazing don't really think and tend to fly as fast as they can since that will destroy more in their mindset. so yes if you go slower than the script defines then it's not kamikaze in script terms. but agin the script was build based on the mindset of a "kamikazer"

Link to comment
Share on other sites

For some weird reason its not working.

The code seems right, and the script is loading....but i am not getting TPd when i try to crash a chopper right on top of the pole, with > 130 speed.

I just crash....I have Godmode on but i dont think that matters.

Plot pole is at coordinates: [54.554,[3268,8807.62,0.064]]    so its not that its off the map or anything.

Really weird.

 

What map??

Link to comment
Share on other sites

diag_log "Loading Anti Kamikaze...";

_centerOfMap = [7200,7200,0];
_AKplotPole = nearestObjects [_centerOfMap, ["Plastic_Pole_EP1_DZ"], 14500];

AK_fnc_GG = {
	if ((vehicle player) isKindOf "Air") then {
		_v = vehicle player;
		_speed = speed _v;
		_coordsVeh = getPos _v;
		_altitude = _coordsVeh select 2;
		if (_altitude > 3.0 && _altitude < 65.0 && _speed >= 130) then {
			_newPos = [_coordsVeh, 150, 300, 10, 0, 20, 0] call BIS_fnc_findSafePos;
			_newPos set [2, 400];
			_v setpos _newPos;
			titleText ["Really!?...what are you... like 4 years old??? Don't kamikaze! (If you try to land fly slower!)", "PLAIN", 3];
		};
	};
};

{
	_trg=createTrigger["EmptyDetector",getPos _x];
	_trg setTriggerArea[50, 50, 0,false];
	_trg setTriggerActivation["WEST","PRESENT",true];
	_trg setTriggerStatements["(vehicle player) in thisList", "call AK_fnc_GG", ""];
	_trg setTriggerType "SWITCH";
	diag_log format["GEEKTEST: Creating Trigger @ %1",getPos _x];
} forEach _AKplotPole;

diag_log "...Anti Kamikaze Loaded!";

Update your server with this one and send me the IP if it still isn't working and i will have a look in the client log

Link to comment
Share on other sites

This is the the same code as the 1st post :) Its the same with the one i am using.

The client log only shows the diag_log "...Anti Kamikaze Loaded!";

No errors, no nothing.

Its ok, i can debug stuff on my own, thanks for the help. Its just that it looks fine..i dont get it why its not working.

I'll disable the anti-hack and see, and add some more diag_logs :)

Link to comment
Share on other sites

Does this log anything when someone attempts a kamikaze, but ends up being TP'd away? If not, could some tye of log be added?

 

Right after the titleText ["Really.....

try adding this:

_player = player getVariable["bodyName", name player];
diag_log format["#### Kamikaze attempt #### Player: %1 tried to do kamikaze at: %2",_player,_coordsVeh];
Link to comment
Share on other sites

This is the the same code as the 1st post :) Its the same with the one i am using.

The client log only shows the diag_log "...Anti Kamikaze Loaded!";

No errors, no nothing.

Its ok, i can debug stuff on my own, thanks for the help. Its just that it looks fine..i dont get it why its not working.

I'll disable the anti-hack and see, and add some more diag_logs :)

It's the same since I just updated the OP ;)

Try and check your client log and search for GEEKTEST

there should be a text called Created Trigger @ coords here

if it's not there then it does not detect any plot poles

Link to comment
Share on other sites

 

Right after the titleText ["Really.....

try adding this:

_player = player getVariable["bodyName", name player];
diag_log format["#### Kamikaze attempt #### Player: %1 tried to do kamikaze at: %2",_player,_coordsVeh];

Would not help as the script runs client side, need to create a public event handler to log to the server RPT

i will post mine if i get time, else search the forum, i saw one post it a few weeks back i think

Link to comment
Share on other sites

well you are correct, but most players who are kamikazing don't really think and tend to fly as fast as they can since that will destroy more in their mindset. so yes if you go slower than the script defines then it's not kamikaze in script terms. but agin the script was build based on the mindset of a "kamikazer"

Good point. Never the less, a great script!

Link to comment
Share on other sites

in my own opinion this will not stop kamikaze at all. I use to have something like this and is just a "layer" of protection to n00bs kamikaze players.

 

People who really do kamikaze will eject right before they enter the trigger and it will NOT stop the empty vehicle going full speed to impact & destroy whatever ur protecting.

 

 

tested.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...