Jump to content
Sign in to follow this  
joske

Using class in addaction

Recommended Posts

So what i am trying to accomplish is that i will be able to approach any empty vehicle in a certain class as defined in the cfgvehicles and an action menu entry will then show up giving me two new entries, one which will set the fuel level of the vehicle in question to zero and set the fuel level of my vehicle to 1 , the other entry will set the vechiclearmor of the vehicle in question to zero and the armor of my vehicle to 1.In other words i want to be able to salvage from other vehicles.

This is what i have so far:

Salvage_repair_action.sqf

_wreck = truck;

_wreck addaction ["Salvage for parts" , "salvage.sqf"];
_wreck addaction ["Salvage for fuel" , "fuel.sqf"];

salvage.sqf

truck setvehiclearmor 0;
heli setvehiclearmor 1;

fuel.sqf

truck setfuel 0;
heli setfuel 1;

The heli in question doesnt need to be defined using the class i just want to be able to set replace the truck in the first script with a class of the cfgvehicle thingy.

ps: if my explanation isnt clear just ask to clarify things.

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  

×