Jump to content
  • 0

Safezone


Sandbird

Question

How can i know in fn_selfActions.sqf if a player is in a Safezone ?

 

In my mission.sqm file i got this to recognize safezones.

		class Item3
		{
			position[]={11463.747,317.3078,11349.89};
			a=140;
			b=140;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			text="Basis_East";
			name="Basis_East";
			expActiv="if (playerSide == WEST) then {[Basis_East] execVM ""safezone.sqf""};inSafeZone = true;";
			expDesactiv="inSafeZone = false;";
			class Effects
			{
			};
		};

And then in the safezone.sqf i can check :

 

if (isNil "inSafezone") then {
    inSafezone = false;
};
 

 

But inSafezone is not recognized in selfActions, so i cant use it in an if statement.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Yeah i was trying to mix it up in order to get that safezone value.....or at least i thought i could.

 

The safezone script its calling is the one with :

 

Private ["_Basis","_EH_Fired"];
ZombieDistance = 10;
_Basis = _this select 0;

 

not the insafezone one.

 

EDIT:

Could i do this ?

In safezone.sqf give the player who is inside a variable:

thePlayer = vehicle player;

_playerLoc =  thePlayer setVariable ["insafezone", 1, true];

 

and then in selfActions grab that variable ?

_playerLoc = cursorTarget getVariable ["insafezone", false];

 

so _playerLoc says if they target player is inside a safezone ?

 

 

Basically what i am trying to do is disable Knockout inside safezone areas.

Link to comment
Share on other sites

  • 0

im not so long in arma scripting but when the safezone variable

if (isNil "inSafezone") then {
    inSafezone = false;
};

is global what it should be because it is an event i think you can do it like that

if (isNil "inSafezone") then {
    inSafezone = false;
};

if(!inSafezone) then {
    //YOUR KNOCKOUT CODE
}

But i dont test it so no prove

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
  • Advertisement
  • Discord

×
×
  • Create New...