Jump to content
Sign in to follow this  
dazholmes

Simple Vehicle Repair Script For Arma 3

Recommended Posts

///////////////////////////////////

// Simple Vehicle Repair & Flip Vehicle Script For Arma 3

// by TAW DAZ

_timeForRepair = 5;

_vehicle = vehicle player;

hint format ["Please wait %1 seconds for repair/flip",_timeForRepair];

sleep _timeForRepair;

if (_vehicle == player) then

{_vehicle = cursorTarget;};

_vehicle setfuel 1;

_vehicle setdamage 0;

_vehicle = nil;

_vehicle = _this select 0;

_vehicle setvectorup [0,0,1];

Just save this in your mission folder repair.sqf now type this code into the init of your vehicle.

this addAction [("<t color=""#66FFFF"">" + ("Repair/Flip") +"</t>"), "repair.sqf",[],1,false,true];

[http://i.imgur.com/bCEk8v5.jpg (269 kB)

Edited by Dazholmes

Share this post


Link to post
Share on other sites

I searched the forums, tried five several scripts, even tinkered with the modules in editor which won`t work after vehicle respawn on dedicated server. I desperately need an repair/rearm/resupply script thats easy to handle.

This one would be great, the only thing is, I need it to work but don't get it to work in a trigger area. Any help would be appreciated.

Share this post


Link to post
Share on other sites

Congrats on the release! Good to see new folks interested in scripting for more than just themselves. At that, welcome to the community as well! I suggest you continue improving your skill with SQF and dish out some more scripts, perhaps even expanding on this one. One thing I've found is that the simple things are always in high demand.

Share this post


Link to post
Share on other sites

Thanks.

Edited by Dazholmes

Share this post


Link to post
Share on other sites

Please help.

_veh is displaying as any in the Repair.sqf (Result: Please wait 2 seconds to repair any). Thus the vehicle is not being repaired.

I am adding the addAction in as part of one script:

VehicleCreate.sqf

// Get variables from vehicle selected
_vehType = _this select 0;

_tank = _vehType createVehicle [0,0,10];
_this addAction [("<t color=""#66FFFF"">" + ("Repair/Flip") +"</t>"), {[_vehType] execvm "Repair.sqf"},[],1,true,true];

then in the repair script I have

Repair.sqf

_veh =  select 0; 
_timeForRepair = 2;
_veh setFuel 1;
_veh setDamage 0;
_veh setVehicleAmmo 1;
_veh setpos [getpos _veh select 0, getpos _veh select 1, 0.5];
 hint format ["Please wait %1 seconds to repair %2",_timeForRepair, _veh];

Share this post


Link to post
Share on other sites

Hey I've Updated the code Here

///////////////////////////////////

// Simple Vehicle Repair & Flip Vehicle Script For Arma 3

// by TAW DAZ

_timeForRepair = 5;

_vehicle = vehicle player;

hint format ["Please wait %1 seconds for repair/flip",_timeForRepair];

sleep _timeForRepair;

if (_vehicle == player) then

{_vehicle = cursorTarget;};

_vehicle setfuel 1;

_vehicle setdamage 0;

_vehicle = nil;

_vehicle = _this select 0;

_vehicle setvectorup [0,0,1];

Share this post


Link to post
Share on other sites

Hi does this still work? And If it does, How could I make it so the player requires the "ToolKit" item to be able to repair?

Share this post


Link to post
Share on other sites


///////////////////////////////////

// Simple Vehicle Repair & Flip Vehicle Script For Arma 3

// by TAW DAZ

if ("Toolkit" in (items player) then //check for toolkit

{

_timeForRepair = 5;

_vehicle = vehicle player;

hint format ["Please wait %1 seconds for repair/flip",_timeForRepair];

sleep _timeForRepair;

if (_vehicle == player) then

{_vehicle = cursorTarget;};

_vehicle setfuel 1;

_vehicle setdamage 0;

_vehicle = nil;

_vehicle = _this select 0;

_vehicle setvectorup [0,0,1];

}

else

{

hint "Toolkit required!";

};

Share this post


Link to post
Share on other sites

Anyway to modify this to instead of repairing vehicles with a toolkit you could heal players with MediKit so when a player has the MediKit they could look at an injured player and scroll heal but takes like 5 seconds for a full heal but cancelled when the medikit player moves from his position. Is that doable?

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  

×