Jump to content
Sign in to follow this  
WurschtBanane

need help with this script

Recommended Posts

[] spawn {

 

    if (isServer && {isDedicated}) exitWith {};

 

waitUntil {!isNull player};

 

 

 

    private "_jet";

 

 

 

_xEHx = player addEventhandler ["respawn",

{

    _jet = createVehicle [selectRandom ["I_Plane_Fighter_03_AA_F", "O_Plane_CAS_02_F", "B_Plane_CAS_01_F"], getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), [], random 10000, "FLY"];

 

(_this select 0) moveInDriver _jet;

 

}];

 

};

 

 

 

This script makes players respawn in jets.

But the problem is that the jet spawns at 100m altitude and often spawns nose down and ends up crashing.

Is there a way to make the plane spawn at 1000m or so so that it doesnt crash?

Share this post


Link to post
Share on other sites
[] spawn
{
    if (isServer && isDedicated) exitWith {};
    waitUntil {!isNull player};
    
    private _xEHx = player addEventhandler ["respawn",
        {
            private _pos = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");//Initial center position
            private _altitude = 1000;//altitude in meters, change to your liking
            private _jet = createVehicle
            [
               selectRandom ["I_Plane_Fighter_03_AA_F", "O_Plane_CAS_02_F", "B_Plane_CAS_01_F"],//Type of  plane
               [_pos select 0,_pos select 1,_altitude]
               ,
               [],
               random 10000,//Random distance from center
               "FLY"//Plane will fly when created
            ];
        (_this select 0) moveInDriver _jet;
        }
    ];
};

Untested, but should work.

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  

×