Jump to content
La Croxyy

[RESOLVED] How do I spawn a command on someone selected though listbox.

Recommended Posts

If the unit is in a vehicle, the vehicle command will return the vehicle.

If the unit is NOT in a vehicle, the vehicle command will return the unit.

 

_veh = vehicle _unit;

if (_veh != _unit) exitWith {hint "The selected player is not in a vehicle!";};

Will therefore exit when the player is currently in a vehicle.

 

Fix:

_veh = vehicle _unit;

if (_veh == _unit) exitWith {hint "The selected player is not in a vehicle!";};

 

Share this post


Link to post
Share on other sites
6 hours ago, Sgt. Dennenboom said:

If the unit is in a vehicle, the vehicle command will return the vehicle.

If the unit is NOT in a vehicle, the vehicle command will return the unit.

 


_veh = vehicle _unit;

if (_veh != _unit) exitWith {hint "The selected player is not in a vehicle!";};

Will therefore exit when the player is currently in a vehicle.

 

Fix:


_veh = vehicle _unit;

if (_veh == _unit) exitWith {hint "The selected player is not in a vehicle!";};

 

Okay, thanks for the help. I'll see if that works now.

Share this post


Link to post
Share on other sites

 

_unit action ["eject", _Veh];

I have stumbled upon another problem, the command to move the selected player out of the vehicle doesn't work. Am I using the command wrong? Or is the problem somewhere else.

Share this post


Link to post
Share on other sites
18 hours ago, La Croxyy said:

 


_unit action ["eject", _Veh];

I have stumbled upon another problem, the command to move the selected player out of the vehicle doesn't work. Am I using the command wrong? Or is the problem somewhere else.

Since you say "selected player" I'm guessing this is for MP. Try this instead:

[_unit, ["eject", _Veh] ] remoteExec ["action", _unit];

  • Like 1

Share this post


Link to post
Share on other sites
 
 
0
 Advanced issues found
 
 
1
On 7/22/2019 at 10:42 PM, GEORGE FLOROS GR said:

 

Hello there La Croxyy !

 

Try to use :

https://community.bistudio.com/wiki/moveOut

 

 

 

 
 
0
 Advanced issues found
 
 
 
On 7/23/2019 at 8:47 AM, mrcurry said:

Since you say "selected player" I'm guessing this is for MP. Try this instead:

[_unit, ["eject", _Veh] ] remoteExec ["action", _unit];

These didn't work either. Most likely an error I made. I'm going to check my code and see if I can get it to work if not, I'll come back 🙂

Share this post


Link to post
Share on other sites

@La Croxyy

1. Fix your previous post, those quotes you put in broke the forum. 

 

2. You should only need to replace your line I quoted with the line I gave you.

 

If that doesn't work you need check your inputs

Share this post


Link to post
Share on other sites

@mrcurry I can't delete the latest post, the edit button is completely broken and doesn't respond.

Share this post


Link to post
Share on other sites

Fixed. Forgot a semicolon at one line and of course, my IDE does not report any errors(definitely will change IDE's).

Thank you, everyone, for your help.

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

×