Forum Jump :

Author Message


Posts: 55
Rank:


Level: Member

Country: de
Location: Hamburg
Occupation:
Age: 20
In-game name: Nerodenecro

 
#1 Posted at 2015-10-26 20:26        
     
Hey guys,

I am currently working on a mission in the map "Ural".
I got "Player1 to Player6".
But only Player1 should be able to enter the Pilot seat of "MainHelo", the others should still be able to enter the helo, just not as Pilot or CoPilot.

I've googled a bit but wasn't able to find even anything close to that.
Help? :D

Regards,

Nerodenecro


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#2 Posted at 2015-10-26 20:40        
     
This should work in a script:
if (!isServer) exitWith {};
while {alive MainHelo} do {
	if (driver MainHelo != Player1) then {moveOut driver MainHelo};
	if (commander MainHelo != Player1) then {moveOut commander MainHelo};
	sleep 1;
};

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message


Posts: 55
Rank:


Level: Member

Country: de
Location: Hamburg
Occupation:
Age: 20
In-game name: Nerodenecro

 
#3 Posted at 2015-10-26 21:52        
     
Hey there,

thanks for the quick answer.
Just in case that I want Player1 and Player2 to be able to enter, what would have to change?

Regards,

Nerodenecro


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#4 Posted at 2015-10-27 11:55        
     
if (!isServer) exitWith {};
_pilots = [Player1, Player2];
while {alive MainHelo} do {
    if (!driver MainHelo in _pilots) then {moveOut driver MainHelo};
    if (!commander MainHelo in _pilots) then {moveOut commander MainHelo};
    sleep 1;
};

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 55
Rank:


Level: Member

Country: de
Location: Hamburg
Occupation:
Age: 20
In-game name: Nerodenecro

 
#5 Posted at 2015-10-27 13:05        
     
Hey wak,

thank you!
You always got the right hand on scripts.

Do I have to run this as script or could I put this into the Init.sqf?

Regards,

Nerodenecro

Added 16 minutes later:

Hey wak,

so some error message pops up, I tried it as Script and in the Init.sqf on both tries the Message pops up.



If the Image doesn't work Image Error Message Link

Any idea?

Regards,

Nerodenecro

This post was edited by Nerodenecro (2015-10-27 13:40, 778 days ago)


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#6 Posted at 2015-10-27 15:15        
     
Just good ol' arma precedence, my bad. This should work now that the exclamation mark is outside the whole parenthesis:

if (!isServer) exitWith {};
_pilots = [Player1, Player2];
while {alive MainHelo} do {
    if !(driver MainHelo in _pilots) then {moveOut driver MainHelo};
    if !(commander MainHelo in _pilots) then {moveOut commander MainHelo};
    sleep 1;
};

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage