Jump to content
Sign in to follow this  
GregRUS

is vehicle attached boolean?

Recommended Posts

Hello guys!

I wrote a small MP script for some vehicles that can attach/detach another landvehicles but there is a problem:

How do I get a boolean of vehicle that have attached another vehicles already to avoid attach collapse?

Thanks.

Share this post


Link to post
Share on other sites

Well you can use setVariable to set data on units. For example you attach unit A and B, then you setVariable something:

_a setVariable ["Attached", _b, true];
_b setVariable ["Attached", _a, true];

If you want to check if something is attached then you can do:

if (!isNil {_a getVariable "Attached"}) then {
//... E.g. detach
};

When you detach you can set the value to nil again

//A and B has been detached
_a setVariable ["Attached", nil, true];
_b setVariable ["Attached", nil, true];

Share this post


Link to post
Share on other sites

Thank you.. but as I understood this is local variables.. and when I rejoin the server they will disappear... also newly connected users cant see this vars too...

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  

×