Jump to content
  • 0

Help script mission add vehicle


elbabar

Question

HI, 

 

I would like to add my mission file via the spawn 5 vehicle on fixed points. 

In my mission i write : 

if(isServer){
BAB_fnc_spawnPlanes = {
	private ["_where","_dir","_models"];
	_where = _this select 0;
	_dir = _this select 1;
	_models = _this select 2;
	_planes = createVehicle [_models,_where,[],0,"CAN_COLLIDE"]; //createvehicle ["NOM_TYPE",getpos,[],0,"CAN_COLLIDE"];
	_planes call EPOCH_server_setVToken;
    _planes call EPOCH_server_vehicleInit;
    _planes setDir _dir;
    _planes allowDamage false;
    _planes setVectorUp (surfaceNormal (getPos _planes));
    _planes lock true;
    _planes allowDamage true;
	
	
	};
_planesPosition = [
					[[22945.3,19177,0.0821691],270,"Sab_af_An2"],
					[[22942.5,19279.2,0.0821695],270,"sab_ca_An2"],
					[[16665.8,10204,0.00143814],0,"Sab_An2_i"],
					[[9947.08,18677,0.00148773],150,"Sab_cz_An2"],
					[[6720.46,8399.26,0.0014267],130,"Sab_ee_An2"]
				];

{
	_pos = _x select 0;
	_degree = _x select 1;
	_models = _x select 2;
	[_pos,_degree,_models] call BAB_fnc_spawnPlanes;

} forEach _planesPosition;
}

The vehicles disappear when I approach them or that I look them. 

 

An idea ?

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Go for it :)

It would be a better alternative to spawning in vehicles using the admin tool as you have no control over where they spawn and they often end up exploding when they spawn somewhere unexpected, plus you could add whatever vehicle you wanted :)

if you could get me the classname in a list 

"namehere"   <--- like that, ill get it done by the end of tomorrow 

only problem is it would be like a command menu meaning it would be on a few pages, unless I can find a pro with Dialogs 

Link to comment
Share on other sites

  • 0

Thanks for the BAB script, it worked perfectly. However when I used a O_UGV_01_F and a I_UGV_01_F as a static vehicle in the script, they spawn First Aid Kits but not the correct FAK which resulted in a BE kick for SetDamage Restriction #0 when I used the first aid kit on another player.

While the spawning of the FirstAidKit is not BAB script problem I would like to know how to either remove what the UGV is spawning or change it to the FAK's. Preferably I would like to change it to FAK.

Perhaps someone has used this script to spawn a static vehicle as a prop like I did and it spawns something you don't want or want to change.

Thanks.

Link to comment
Share on other sites

  • 0

Update: So, someone told me today that there is cleanup script to remove items from spawning in static vehicles. While I have not found that script yet, it still defeats what I am trying to do.

Still trying to figure out how to swap out what is spawning in the static vehicle with something different. Specifically, it currently spawns FirstAIdKits. I want it to spawn FAK's.

Thanks.

Link to comment
Share on other sites

  • 0

Has this stopped working for anyone since the latest updates?  I recently started getting the following errors.  Can anyone explain to me what that means?  Is line 7 going to be line 8 like the BE filter stuff? I have combed through a lot of files and cant find an issue. Sorry, I am still learning and while I think this is telling me there is a problem with the script, I have the same script running on my home/test server and it works. Just not working on the live public server and I cant figure out why.

 

planes call EPOCH_server_setVToken;

_planes call EPO>

15:36:44 Error position: <EPOCH_server_setVToken;

_planes call EPO>

15:36:44 Error Undefined variable in expression: epoch_server_setvtoken

15:36:44 File BAB\functions\fn_spawnplanes.sqf, line 7

15:36:44 "Epoch: Init Variables"

15:36:44 Error in expression <here,[],0,"CAN_COLLIDE"];

_planes call EPOCH_server_setVToken;

_planes call EPO>

15:36:44 Error position: <EPOCH_server_setVToken;

_planes call EPO>

15:36:44 Error Undefined variable in expression: epoch_server_setvtoken

15:36:44 File BAB\functions\fn_spawnplanes.sqf, line 7

15:36:44 Error in expression <here,[],0,"CAN_COLLIDE"];

_planes call EPOCH_server_setVToken;

_planes call EPO>

15:36:44 Error position: <EPOCH_server_setVToken;

_planes call EPO>

15:36:44 Error Undefined variable in expression: epoch_server_setvtoken

15:36:44 File BAB\functions\fn_spawnplanes.sqf, line 7

15:36:44 "Loading config..."

15:36:45 [sDROP]: Starting Supply Drop Mission Framework.

15:36:45 [sDROP]: Functions loaded. Starting supply drop timer.

The fn_spawnplanes.sqf

private ["_where","_dir","_models"];

_where = _this select 0;

_dir = _this select 1;

_models = _this select 2;

_planes = createVehicle [_models,_where,[],0,"CAN_COLLIDE"]; //createvehicle ["NOM_TYPE",getpos,[],0,"CAN_COLLIDE"];

_planes call EPOCH_server_setVToken;

_planes call EPOCH_server_planesicleInit;

_planes setDir _dir;

_planes allowDamage false;

_planes setVectorUp (surfaceNormal (getPos _planes));

_planes lock true;

_planes allowDamage true;

Edit: Well, 8 hours later, after disabling scripts, one by one, in my mission init, I found that Halv's script for repair/rearm was causing problems. I moved some things around in my init file and it fixed the issue. Lesson learned.

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