Jump to content
Lopalmcivet _

SQF that can detect the speed of the player's aircraft?

Recommended Posts

Basically, I want the script to detect that if the player is on a plane with the classname Z_planeA, and the plane's speed exceeds 600km, it switches from the blufor to the civilian and hints [high-speed diving mode], and returns to the plane when the speed is lower than 600km. to the blufor

 

I have used trigger to achieve this function before but I want to make it to script

 

The trigger condition is:
speed vehicle player >= 600


The triggering effect is:
_newGroup = createGroup CIVILIAN;
if (playerSide isEqualTo west) then
{
[player] joinSilent _newGroup;
};hint "This machine is detaching at high speed"


The effect when not triggered is:
[player] joinSilent createGroup west;hint "Release high-speed breakaway state"

 

anyone can help me please?

Share this post


Link to post
Share on other sites

The reason why I want to implement this script is because it can achieve the effect of the aircraft escaping in a high-speed dive. After the player aircraft switches to the civilian, AI aircraft will abandon the target and return after chasing the player for a period of time. I think this is really cool. I use trigger implemented this function but I want it to be sqf

Share this post


Link to post
Share on other sites
[] spawn {
  private "_speeding";
  while {true} do {
    sleep 1;
    _speeding = speed objectParent player > 600;
    player setCaptive _speeding;
    if (objectParent player isKindOf "plane") then {hintSilent format ["You're %1 speeding",["not",""] select _speeding]};
  };
};


 

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

×