Jump to content
Sign in to follow this  
cobra5000

No Fly Zone

Recommended Posts

Do you know how i make No Fly Zone missions by scripts or something else?

Share this post


Link to post
Share on other sites

create a trigger covering the area you want to enforce nofly zone in.

make it repeating, anyone present.

cond:

({(getPos (vehicle _x) select 2) > 5} count thisList)  != 0

on act:

{if (((vehicle _x) iskindof "helicopter" OR (vehicle _x) isKindof "Plane") AND (getPos (vehicle _x) select 2) > 1) then {(vehicle _x) setDammage 1};

You can replace setDammage 1 with setFuel 0 to not destroy it but rather empty its fuel and make it "stop" flying, also 5 is the height the vehicle must be above before counted in, you can set it higher or lower.

Also you can try this for condition to ease the load:

cond:

({((vehicle _x) iskindof "helicopter" OR (vehicle _x) isKindof "Plane") AND (getPos (vehicle _x) select 2) > 5} count thisList)  != 0

on act: same as above.

Share this post


Link to post
Share on other sites

I realise this is an ancient thread but there didn't seem to be a point in making a new one.

I tried this out today and it didn't seem to work for me. I want to make several zones that remove the fuel of any BLUFOR aircraft that enter it. It is important that this only effects aircraft as a ground team will be operating to shut down the "EMP grid" (the excuse for removing all the fuel) below. This also has to be compatible with Multi-player.

When I tried to use the information provided above it came up with an error in the activation, right at the start, and wouldn't tell me what was wrong. It may be something simple but I only know the basics of the editor. Could any-one help me out here?

Share this post


Link to post
Share on other sites

Create a trigger, set it to bluefor present, make it repeating.

Then put this under condition (not under activiation!):

{ if ( (vehicle _x) isKindOf "Air" && ((getPos _x) select 2) > 5 ) then { (vehicle _x) setFuel 0; }; } forEach thisList;

Leave activation empty.

Share this post


Link to post
Share on other sites

I'm getting "type Nothing, expected bool" at the very very start of that entry... Any ideas? Also, I'll be adding a "disarm" section,, I assume I can get away with adding "&& !shutdown" on the end ?

Edited by SSgt_P_Long

Share this post


Link to post
Share on other sites

Oh, right. My bad.

{ if ( (vehicle _x) isKindOf "Air" && ((getPos _x) select 2) > 5 ) then { (vehicle _x) setFuel 0; }; } forEach thisList; false;

Yeh adding the "disarm" is no problem, however: You could also simply remove the trigger, unless you need to be able to reactivate it.

Share this post


Link to post
Share on other sites

Thank you very much sir, this has solved the days worth of frustrated attempts I have done trying to make it work! I didn't realise I could delete triggers, I'll look into that now. Once I work out how to change the colour of the markers I'll be glad to say that's the difficult stuff out of the way!

Once again, thanks pal, I was just about ready to give up there.

Share this post


Link to post
Share on other sites

Okay, all of the above accomplished! I have only got 1 problem left to solve... I want to add a hint in to tell the pilot they have been caught in the EMP. I figured this would be as simple as adding the (hint "text") in the activation of what was already there... It seems I was wrong. I hate to keep asking for help but once more I'm stumped... Any ideas?

Share this post


Link to post
Share on other sites

Sure, the thing about the trigger I made is: It never actually triggers. This is to prevent problems with the way the activation/deactivation on triggers work.

Anyway.

{ if ( (vehicle _x) isKindOf "Air" && ((getPos _x) select 2) > 5 ) then {[color="#00FF00"] (vehicle _x) setFuel 0; [/color]}; } forEach thisList; false;

What I've colored green is basically the "activation" part of this special trigger.

This should do the trick:

{ if ( (vehicle _x) isKindOf "Air" && ((getPos _x) select 2) > 5 ) then { (vehicle _x) setFuel 0; if (local _x) then { hint "Warning... bla bla..."; }; }; } forEach thisList; false;

However, at this point I would normally use an external .sqf file for it, otherwise it gets a bit ... too complex.

Especially as the warning is rather pointless, because you don't have time to react.

So use this instead:

{ nul=[_x] execVM "emp.sqf" } forEach thisList; false;

Create the emp.sqf file in your missionfolder:

//emp.sqf
_unit = _this select 0;
_veh = vehicle _unit;
_pos = getPos _unit;
_limit = 	30;	// how much emp a unit can take, before going down (doesn't regenerate)

if ( _veh isKindOf "Air" && (_pos select 2) > 5 ) then {
if (local _unit) then {
	hint "Warning, entering EMP grid!";

	_emp = _veh getVariable ["emp", 0];
	_emp = _emp + 1;
	_veh setVariable ["emp", _emp, true];
	if (_emp > _limit) then {
		_veh setFuel 0;
	};
};
};

Edited by Tajin

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
Sign in to follow this  

×