Jump to content
Sign in to follow this  
Blitzer134

defineing this ?

Recommended Posts

trying to define this code red line has the error any help would be appreciated

private ["_unit"];
_unit = _this select 0;

WaitUntil{(getPos _unit select 2)<2};
sleep 3;
[color="#FF0000"]if((getPos _unit select 2)>2 || not (_unit in list Rearmlist)) exitWith{};[/color]

_unit setFuel 0;
_unit VehicleChat "Repairing......";
sleep 15;

_unit setDammage 0;
_unit VehicleChat "Rearming......";
sleep 12;

_unit setVehicleAmmo 1;
_unit VehicleChat "Refueling......";
sleep 10;

_unit setFuel 1;
_unit VehicleChat "Finished!";

if(true) exitWith{};

calling via trigger

{[_x] execVM "script.sqf"} foreach thislist;

thanks

Share this post


Link to post
Share on other sites

if (getPos (_unit select 2) > 2) or  ! (_unit in list Rearmlist)) exitWith {};

Im not professional but I think that works.

The name of the trigger should be Rearmlist

Share this post


Link to post
Share on other sites

It's working fine, check trigger name as mentioned or if your using an array ie Rearmlist = [unit1,unit2,unit3] remove the list bit.

Share this post


Link to post
Share on other sites

if (((getPos _unit select 2) > 2) or  ! (_unit in list Rearmlist)) exitWith {};

I'm sorry I was wrong, this works sure :)

And yes, your script works too, be sure name your trigger with Rearmlist

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  

×