Jump to content
  • 0

Adding a plane to the map (sounds simple)


Liqu1dShadow

Question

Ok, I need some help here, I have tried in my efforts to make this work. (and the vehicle just gets deleted after I get within 300m of it)

 

If I wanted to add a plane/vehicles at cords... (8500, 2500, 0) then another at (8600, 2500, 0 ) how would I do this, as a start to finish instruction in simple English lol,

 

What I am looking for is static vehicle on the map, that re-spawns each restart and then tells the player that when they get in

 

Pretend the Class name in M_Plane_F to keep it easy

 

Thanks

 

Aaron

 

 

 

 

 

 

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Would this work?

 

_vehicle_8 = objNull;
if (true) then
{

 

    _veh = createVehicle["M_Plane_F", _spawnPos, [8500, 2500, 0.01], 0, "NO_COLLIDE"];
    _veh call EPOCH_server_setVToken;

    _vehicle_8 = _this;
    _this setDir 90.314346;
    _this setPos [8500, 2500, 0.01];
};

Link to comment
Share on other sites

  • 0

I have some vehicles spawned through an sqf file in my custom pbo that are just props essentially and they do the same thing, ie dissapear.

 

This is the format :

 

["O_Truck_03_device_F",[23276.7,18452.2,0],98.8637,[[0.988058,-0.154085,0],[0,-0,1]],false],

 

I am assuming I cannot use the setVToken so what could I use in this situation ?

Link to comment
Share on other sites

  • 0

  like this?

 

    ["Land_Cargo40_grey_F",[14098.1,11319.6,0],8.18185,[[0.142315,0.989821,0],[0,0,1]],false],
    ["M_Plane_F",[14101.3,11319,2.52089],25,[[0.422618,0.906308,0],[0,0,1]],false],

    _veh call EPOCH_server_setVToken;
    ["Land_WaterTank_F",[14103.3,11315.9,0.063942],0,[[0,1,0],[0,0,1]],false],
    ["Land_Billboard_F",[14101.7,11319.9,4.10601],205,[[-0.422618,-0.906308,0],[-0,0,1]],false]

Link to comment
Share on other sites

  • 0

In your mission init.sqf, 

if (isServer) then
{
	_veh = createVehicle["M_Plane_F", _spawnPos, [8500, 2500, 0.01], 0, "NO_COLLIDE"];
	_veh setDir 90.314346;
	_veh setPos [8500, 2500, 0.01];
	_veh call EPOCH_server_setVToken;
};

Or, if using M3Editor script, make sure the script is run on the server:

private ["_objs"];
_objs = [
	["M_Plane_F",[11506.4,11653.6,0],0,[[0,1,0],[0,0,1]],false]
];

{
	private ["_obj"];
	_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	if (_x select 4) then {
		_obj setDir (_x select 2);
		_obj setPos (_x select 1);
	} else {
		_obj setPosATL (_x select 1);
		_obj setVectorDirAndUp (_x select 3);
	};
	if ((_obj iskindof "Air") || (_obj iskindof "Tank") || (_obj isKindOf "Land") || (_obj isKindOf "Ship"))then{ //Add this to check for vehicles and set the vToken
		_obj call EPOCH_server_setVToken;
	};
} foreach _objs;
Link to comment
Share on other sites

  • 0

 

In your mission init.sqf, 

if (isServer) then
{
	_veh = createVehicle["M_Plane_F", _spawnPos, [8500, 2500, 0.01], 0, "NO_COLLIDE"];
	_veh setDir 90.314346;
	_veh setPos [8500, 2500, 0.01];
	_veh call EPOCH_server_setVToken;
};

Or, if using M3Editor script, make sure the script is run on the server:

private ["_objs"];
_objs = [
	["M_Plane_F",[11506.4,11653.6,0],0,[[0,1,0],[0,0,1]],false]
];

{
	private ["_obj"];
	_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	if (_x select 4) then {
		_obj setDir (_x select 2);
		_obj setPos (_x select 1);
	} else {
		_obj setPosATL (_x select 1);
		_obj setVectorDirAndUp (_x select 3);
	};
	if ((_obj iskindof "Air") || (_obj iskindof "Tank") || (_obj isKindOf "Land") || (_obj isKindOf "Ship"))then{ //Add this to check for vehicles and set the vToken
		_obj call EPOCH_server_setVToken;
	};
} foreach _objs;

 

 

Using this for vehicles spawned in with M3 Editor works perfectly thank you Silens  :)

 

One disadvantage may be that they are useable if you wanted to use them as props only, I am not sure if they persist in the database as yet though after restart.

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

×
×
  • Create New...