Jump to content
  • 0

AGN Safezones Speed Limit Script?


Tricks

Question

10 answers to this question

Recommended Posts

  • 0

Just create a file called speedlimit.sqf (code below) in your mission file scripts folder

	speedlimit = [] spawn {
		_maxspeed = 25;
		while {!canbuild} do {
			waitUntil {vehicle player != player and !((vehicle player) isKindOf 'Air')};
			_vehicle = vehicle player;
			_curspeed = speed _vehicle;
			if (_curspeed > _maxspeed) then {
				_vel = velocity _vehicle;
				_dir = direction _vehicle;
				_speed = _curspeed - _maxspeed;
				_vehicle setVelocity [(_vel select 0)-((sin _dir)*_speed),(_vel select 1)- ((cos _dir)*_speed),(_vel select 2)];
			};
			sleep 0.1;
		};
	};

I call this from the sensors in the mission.sqm as per below, 1 of my sensors, so you can edit your own to call the speedlimit.sqf

class Item0
		{
			position[]={6325.6772,304.99033,7807.7412};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zonestary";
			expCond="(player distance zonestary) < 75;";
			expActiv="canbuild = false; clearzeds = [] execVM ""custom\clearzeds.sqf""; speedlimit = [] execVM ""custom\speedlimit.sqf"";  titleText [""\n\nEntering the trader - god mode on"", ""PLAIN DOWN"", 1];";
            expDesactiv="canbuild = true; terminate clearzeds; terminate speedlimit; titleText [""\n\nLeaving the trader - god mode off"", ""PLAIN DOWN"", 1];";
			class Effects			
			{
			};
		};

Hope this helps

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...