Jump to content
Sign in to follow this  
mihikle

No damage taken within a Trigger radius

Recommended Posts

Sorry to ask another question again so soon, however I have run into another issue:

Is it possible to take NO DAMAGE within a certain TRIGGER RADIUS? To prevent TK at spawn etc, as this is being put on a public server in the future.

Thanks!

Share this post


Link to post
Share on other sites

{_x allowdamage false} foreach units thisList;

on deactivation

this allowDamage true (unsure but it should work)

Share this post


Link to post
Share on other sites

Hmm I can't get that to work.

Activation: Blufor, present

Condition: This

On Act.: {_x allowdamage false} foreach units thisList;

On Dea.: this allowDamage true

Does nothing! D:

Share this post


Link to post
Share on other sites

{_x allowdamage false} foreach thisList;

"units" return the array of units within a group, not a trigger.

Share this post


Link to post
Share on other sites

Using a trigger isn't going to give you what your after. When you leave the trigger you will still be protected. Also unless you force an update of the trigger the protection won't apply to other units entering the trigger only those present the first time it fires.

See if these will help

http://forums.bistudio.com/showthread.php?123333-Invisible-Shield-%28Spawn-Protection%29-Help&highlight=protection

http://forums.bistudio.com/showthread.php?115203-Spawn-protection-%28shield%29

Share this post


Link to post
Share on other sites

If u play Coop mission,this solution working for u.

game Logic

safezone = { _obj = _this select 0;thislist = _this select 1; _obj allowdamage false; waituntil {!(_obj in thislist)}; hint "out from safezone"; _obj allowdamage true;};

Trigger:

trigger cover base area.

50X50,anybody,present,repeatably

condition:true

act:

{[_x,thislist] spawn safezone} foreach thisList

and add

this allowdamage false

to players init.

Share this post


Link to post
Share on other sites

You could also just create a game logic as the center of the are which the player will be protected in and call it "ProtectionCenter" or something like that.

Then in the init.sqf :

[player] execVM "spawnProtection.sqf";

spawnProtection.sqf :

_unit = (_this select 0);
while {true} do
{
_unit allowDamage true;
_distance = (_unit distance ProtectionCenter);
if (_distance <= SAFEDISTANCE) then  // edit "SAFEDISTANCE" to fit the radius you want the player to be protected in
{
	_unit allowDamage false;
               waitUntil {(_unit distance ProtectionCenter) > SAFEDISTANCE};
}
       else
       {
        waitUntil {(_unit distance ProtectionCenter) <= SAFEDISTANCE};
       };
};

This is untested.

Edited by FreakJoe

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  

×