Jump to content
Sign in to follow this  
cougarxr7

Entered vehicle return info.

Recommended Posts

Hello,

I am looking for the command that returns what vehicle a player had just entered. e.g.

if (vehicle player in MH6) then 
          {hint "This is a MH6!";
           }else{
           hint "this is not a MH6!";
           };

Thanks!

Share this post


Link to post
Share on other sites

Try this mate....

In the editor....place a soldier (player). Place an empty MH-6J.

Create a script...here it's called myscript.sqf....and put it in your mission folder :-

"myscript.sqf" .....

while {true} do {
   if (vehicle player [url="http://community.bistudio.com/wiki/isKindOf"]isKindOf[/url] "MH6J_EP1") then {
       hintsilent "This is an MH6";
   } else {
       hintsilent "This is not an MH6";
   };
   sleep 1;
};

To call the script put this code in the players Init field:-

nul = [] execVM "myscript.sqf";

Get in the chopper to see the hint change.

There are other ways to do this....but this is following what you have there.

Share this post


Link to post
Share on other sites

Thanks for the reply twirly, I will try that however I did find in a script of Mondos Winch that worked perfect!


_mh6 = _this select 0;
_unit = _this select 1;
_vec = _this select 2;
_vectype = typeof _vec;

_doexit = 1;
if(_vectype == "MH6") then { _doexit = 1; };
if(_doexit == 1) exitWith {};

Again Thanks!

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  

×