Jump to content
Sign in to follow this  
dragon zen

Need Help with BIS_fnc_spawnVehicle

Recommended Posts

===============

Problem has been killed.

Thanks zapat

===============

Hello friends, I have a question:

Does BIS_fnc_spawnVehicle must enter "AH1Z" directly, rather than use a variable?? I write:

AHType="AH1Z";

_heligp = [_pos, _angle, AHType, _gp] call BIS_fnc_spawnVehicle;

It doesn't work!! write "AH1Z" directly is OK.

Anybody tell me why??:confused:

THANKS

Edited by Dragon Zen

Share this post


Link to post
Share on other sites

Then your variable may not have been properly "initialized". Do you give it a value right before calling, or somewhere else in the script?

What does a

hint str AHType;

placed just before the spawnvehicle line says?

Share this post


Link to post
Share on other sites

In addition:

If the BIS_fnc_spawnVehicle just can't use variable, then I want to know how to create a AH1Z flying.

If I just create it as car, it will crash from air...

Share this post


Link to post
Share on other sites

It can use a variable of course!

If you "createVehicle" it, it won't have crew to drive it.

Have you tried to hint the value of AHType?

Share this post


Link to post
Share on other sites
Then your variable may not have been properly "initialized". Do you give it a value right before calling, or somewhere else in the script?

What does a

hint str AHType;

placed just before the spawnvehicle line says?

I try hint str AHType, it is "AH1Z".

No matter I put AHType or str AHType in function, it doesn't work...

---------- Post added at 03:29 PM ---------- Previous post was at 03:21 PM ----------

OK, thanks bro.

Problem solved.

I just get another error in my script.:o

THANKS FOR YOUR HELP!!

Share this post


Link to post
Share on other sites

For the position give the z coordinate of the position [x,y,z] a value. Other than that the code works fine.

Seems you have something going on somewhere with AHType. Look for previous occurences of it and see if you can sort it out.

I used position player here to test. But you probably need [_pos select 0 , _pos select 1, 100] to create the helo 100m up.

AHType = "AH1Z";

_heligp = [[b][(position player) select 0,(position player) select 1,100][/b], 10, AHType, west] call BIS_fnc_spawnVehicle;

Share this post


Link to post
Share on other sites

twirly: it is not necessary needed.

If you pass a 2D position the function sets starting z to 50, unless you already have a value explicitly set to z of _pos.

So IMHO explicit z is only needed if you pass a 3D pos with a very low (like less than 10) z value.

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  

×