Jump to content
Sign in to follow this  
simicsko

Spawn empty vehicle with script

Recommended Posts

Hi guys, i need help:

 

How can i spawn an empty (without crew) vehicle?

I tried this but it doesn't work:

 

car1 = ["B_MRAP_01_hmg_F", getPos player, 180, west,[], 0,"NONE"] call BIS_fnc_spawnVehicle;
deleteVehicleCrew car1;

Share this post


Link to post
Share on other sites
1 hour ago, Harzach said:

 

I've seen this website before. Where on this website is the solution for me? What do I do wrong?

 

I tried this but it doesn't work:

_car1 = ["B_MRAP_01_hmg_F", getPos player, 180, west,[], 0,"NONE"] call BIS_fnc_spawnVehicle;
{ _car1 deleteVehicleCrew _x } forEach crew _car1;

 

I got this error:

{ _car1 deleteVehicleCrew _x } forEach crew _car1;

Error Generic error in expression

 

The vehicle spawned, but the cerw is inside.

 

UPDATE:

sorry, I didn't focus enough: the deleteVehicleCrew command only works with the createVehicle command:

 

_car1 = "B_MRAP_01_hmg_F" createVehicle position player;
{_car1 deleteVehicleCrew _x} forEach crew _car1;

 

It works, thank You for Your help Harzach. 🙂

Share this post


Link to post
Share on other sites
1 hour ago, simicsko said:

sorry, I didn't focus enough: the deleteVehicleCrew command only works with the createVehicle command:

What... that's not why it didn't work. The reason why is the return value of BIS_fnc_spawnVehicle (_car1) was not an object. Also, createVehicle does spawn an empty vehicle, so you simply don't need that line.

  • Like 2

Share this post


Link to post
Share on other sites

As @POLPOX says, createVehicle creates an empty vehicle (as opposed to BIS_fnc_spawnVehicle, which spawns a fully crewed vehicle). Reading the Biki entries for these commands/functions will provide you with this information.

 

 

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, POLPOX said:

What... that's not why it didn't work. The reason why is the return value of BIS_fnc_spawnVehicle (_car1) was not an object. Also, createVehicle does spawn an empty vehicle, so you simply don't need that line.

 

Ohhh... really! Tank you for information. 😉

Share this post


Link to post
Share on other sites
3 hours ago, Harzach said:

As @POLPOX says, createVehicle creates an empty vehicle (as opposed to BIS_fnc_spawnVehicle, which spawns a fully crewed vehicle). Reading the Biki entries for these commands/functions will provide you with this information.

 

 

 

Yes, now I understand. Sorry to ask too simple questions at times, but now I'm learning this scripting method, so it's not always clear to me what's being described. Thanks for help. 🙂

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  

×