Jump to content
Madin

Is it possible to allow repair only one vehicle/make toolkit only 1-3 use/disable certain vehicle to be repaired?

Recommended Posts

Hi. i need something as in title. Any suggestions?  :)

Share this post


Link to post
Share on other sites

you mean allowing the repair of a certain type of vehicle?

 

Share this post


Link to post
Share on other sites

You can choose what king of vehicle you can repair or even declare an array of specific vehicle and, add a counter on toolkit use.

 

This script will allow you to disable repair on tanks, and repair the other vehicles, only 3 times with the same toolkit:

 

MGIRepairCnt = 0;
inGameUISetEventHandler ["Action","
  if (_this select 3 == 'repairVehicle') then {
    if ((_this select 0) isKindOf 'tank') then {
      hint 'You cant repair this vehicle';
      true
    } else {
      MGIRepairCnt = MGIRepairCnt + 1;
      if (MGIRepairCnt == 4) exitWith {
        player removeItemFromBackpack 'toolKit';
        MGIRepairCnt = 0;
        true
       };
      false
    };
  }
"];

 

  • Like 1

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

×