Jump to content
  • 0

Help editing small block of code for safezone


DangerRuss

Question

Currently using infiStar's safe zone and using the speed limit. However, I dont want helicopters to be effected by the speed limit, only land vehicles
 

                if (_USE_SPEEDLIMIT) then
                {
                    _obj = vehicle player;
                    if !(_obj isKindOf 'Plane') then
                    {
                        _speed = abs speed _obj;
                        if ((_obj != player) && (_speed > _speedlimit)) then
                        {
                            _vel = velocity _obj;
                            _x = 0.8;
                            if (_speed > 50) then {_x = 0.1;};
                            _velNew = [(_vel select 0) * _x, (_vel select 1) * _x,(_vel select 2) * _x];
                            _obj SetVelocity _velNew;
                        };
                    };
                };

can I just change "Plane" to "Air" ? or is there some other way to add another exception? thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Currently using infiStar's safe zone and using the speed limit. However, I dont want helicopters to be effected by the speed limit, only land vehicles

 

                if (_USE_SPEEDLIMIT) then
                {
                    _obj = vehicle player;
                    if !(_obj isKindOf 'Plane') then
                    {
                        _speed = abs speed _obj;
                        if ((_obj != player) && (_speed > _speedlimit)) then
                        {
                            _vel = velocity _obj;
                            _x = 0.8;
                            if (_speed > 50) then {_x = 0.1;};
                            _velNew = [(_vel select 0) * _x, (_vel select 1) * _x,(_vel select 2) * _x];
                            _obj SetVelocity _velNew;
                        };
                    };
                };

can I just change "Plane" to "Air" ? or is there some other way to add another exception? thanks

 

Switching it to Air should work just fine.

Link to comment
Share on other sites

  • 0

Alright one more for you if you dont mind :)

 

		_notInSafeZone =
		[
			'MAAWS','RPG7V','M136','RPG18','STINGER',
			'MeleeHatchet_DZE','MeleeHatchet','MeleeCrowbar','MeleeMachete','MeleeFishingPole','MeleeSledge',
			'MeleeBaseBallBatNails','MeleeBaseBallBatBarbed','MeleeBaseBallBat'
		];

I want to block all launchers from the safe zone.. do I have to just add them one by one to the array or can I just use a base like launchers? What would be the easiest way?

 

to be clear I already went ahead and just manually added every launcher to this array but for the sake of learning I just wanted to know if theres an easier way.

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

×
×
  • Create New...