Jump to content
Sign in to follow this  
1para{god-father}

Spawn heli and set name to it

Recommended Posts

Hi guys,

I am spawning in a chopper but need some help

I am using this to spawn it in on a trigger:-

_heli = createVehicle ["Ka52Black", getMarkerPos "helimarker", [], 0, "NONE"]; 

but i need to name it stealm18 and set allowdamage false

How do i set the name ?

thanks

Share this post


Link to post
Share on other sites

Thanks

So i have ste the name , but the fuel will not remove ?

Is this not corrects ?

_heli = createVehicle ["Ka52Black", getMarkerPos "helimarker", [], 0, "NONE"];
_VarName="stealm18";
_Object SetVehicleVarName _VarName;  
_VarName setFuel 0; 
_VarName allowDamage false;

Share this post


Link to post
Share on other sites

_spheli = _heli select 0;
_vehicle setvehiclevarname "stealm18";
_vehicle Call Compile Format ["%1=_This ; PublicVariable ""%1""","stealm18"];

This should work.

You can still use a local variable for it yeah.

Share this post


Link to post
Share on other sites

Nope still no Joy it spawns fine but it has fuel in ?

_heli = createVehicle ["Ka52Black", getMarkerPos "helimarker", [], 0, "NONE"];
_vehicle setvehiclevarname "stealm18";
_vehicle Call Compile Format ["%1=_This ; PublicVariable ""%1""","stealm18"];
_vehicle setFuel 0; 
_vehicle allowDamage false;

Share this post


Link to post
Share on other sites

try placing this line before the setFuel line you have:

waitUntil {(fuel _vehicle) == 1};

or use a sleep 1; before the setFuel line.

Share this post


Link to post
Share on other sites

This works:

stealm18 = createVehicle ["Ka52Black", getMarkerPos "helimarker", [], 0, "NONE"];
stealm18 setvehiclevarname "stealm18";

stealm18 setFuel 0; 
stealm18 allowDamage false;

why more complicated?

And what is _vehicle in your code? It don´t see where it points.

Or just:

_vehicle = createVehicle ["Ka52Black", getMarkerPos "helimarker", [], 0, "NONE"];
_vehicle setvehiclevarname "stealm18";
_vehicle Call Compile Format ["%1=_This ; PublicVariable ""%1""","stealm18"];
_vehicle setFuel 0; 
_vehicle allowDamage false;

Edited by Melmarkian

Share this post


Link to post
Share on other sites

if i want to then put fuel back in via a trigger i presume this should work ?

stealm18 setFuel 1;

but it does not ?

sorry it does my bad !

stealm18 = createVehicle ["Ka52Black", getMarkerPos "helimarker", [], 0, "NONE"];

--------------------

But this does not how would i call it just for info as i thought it would be the same now ?!

_vehicle = createVehicle ["Ka52Black", getMarkerPos "helimarker", [], 0, "NONE"];

_vehicle Call Compile Format ["%1=_This ; PublicVariable ""%1""","stealm18"];

Edited by psvialli

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  

×