Jump to content
Sign in to follow this  
hogmason

faction to class name in found script

Recommended Posts

how can i change this line from a faction to a classname of a unit


_id = _x addAction ["Repair Vehicle", "HOG_scripts\Vehicle_Repair\vehicleRepair.sqf", [], 1, false, true, "", "(getDammage _target) < 1 AND (getDammage _target) > 0 AND [color="#FF0000"](faction _this) == 'BIS_US' [/color]AND (vehicle _this) == _this"];

Share this post


Link to post
Share on other sites

ok so now i need to let this script be used by multiple classnames i tried an array but doeasnt work


_[color="#FF0000"][/color][color="#FF0000"]units = [uSMC_SoldierS_Engineer, US_Soldier_Engineer_EP1,BAF_Soldier_EN_W,
         BAF_Soldier_EN_DDPM,BAF_Soldier_EN_MTP,Soldier_Engineer_PMC,CDF_Soldier_Engineer];[/color]


_id = _x addAction ["Repair Vehicle", "HOG_scripts\HOG_mechanic\repair.sqf", [], 1, false, true, "", "(getDammage _target) < 1 AND (getDammage _target) > 0 AND [color="#FF0000"](typeOf _this) !== _units [/color]AND (vehicle _this) == _this"];

how can i do this

Share this post


Link to post
Share on other sites

_[color="#FF0000"][/color][color="#FF0000"]units = [uSMC_SoldierS_Engineer, US_Soldier_Engineer_EP1,BAF_Soldier_EN_W,
         BAF_Soldier_EN_DDPM,BAF_Soldier_EN_MTP,Soldier_Engineer_PMC,CDF_Soldier_Engineer];[/color]

There might be more problems but something really stands out there mate.... classnames are strings so you need quotes.

_units = ["USMC_SoldierS_Engineer", "US_Soldier_Engineer_EP1","BAF_Soldier_EN_W",
         "BAF_Soldier_EN_DDPM","BAF_Soldier_EN_MTP,Soldier_Engineer_PMC","CDF_Soldier_Engineer"];

Share this post


Link to post
Share on other sites
ok so now i need to let this script be used by multiple classnames i tried an array but doeasnt work


_[color="#FF0000"][/color][color="#FF0000"]units = [uSMC_SoldierS_Engineer, US_Soldier_Engineer_EP1,BAF_Soldier_EN_W,
         BAF_Soldier_EN_DDPM,BAF_Soldier_EN_MTP,Soldier_Engineer_PMC,CDF_Soldier_Engineer];[/color]


_id = _x addAction ["Repair Vehicle", "HOG_scripts\HOG_mechanic\repair.sqf", [], 1, false, true, "", "(getDammage _target) < 1 AND (getDammage _target) > 0 AND [color="#FF0000"](typeOf _this) !== _units [/color]AND (vehicle _this) == _this"];

how can i do this

you had this answered in this post:

array inside an addaction

and here:

typeof inside of an if command not working

Edited by panther42

Share this post


Link to post
Share on other sites

yeah i ended using side then later on in the script adding a classname chack

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  

×