Jump to content
Sign in to follow this  
MasterPuffin

[Release] Repair Script

Recommended Posts

When using this script Toolkits can be used to repair a vehicle. Repairing the vehicle will take some time. 

 

********************************

_truck=cursortarget;
if (vehicle player == player) then {
	if (player distance _truck < 3) then {
		if ("ToolKit" in items player) then {
			if(animationState player != "AinvPknlMstpsnonWnonDnon_medic_1" ) then {
				player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
				sleep 3;
				player playActionNow "stop";
				player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
				sleep 3;
				player playActionNow "stop";
				player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
				sleep 3;
			};
		sleep 3;
		player removeItem "ToolKit";
		_truck setdammage 0;
		hintSilent "Repaired vehicle";
	}
	else
		{
		hintSilent "You need a toolkit to repair this vehicle!";
		};
	};
};

You can either use addaction or a keyhandler to execute the script.

 

If you have any questions or need help with your mission feel free to ask!

Cheers

Puffin

  • Like 2

Share this post


Link to post
Share on other sites

I would recommend to put the hintSilent as a translatable label instead of fixed in german

 

hintSilent localize "STR_REPAIRED"

Then you can internationalise your script

Share this post


Link to post
Share on other sites
32 minutes ago, celludriel said:

I would recommend to put the hintSilent as a translatable label instead of fixed in german

 


hintSilent localize "STR_REPAIRED"

Then you can internationalise your script

You are right, I changed my code to English. But for the sake of simplicity I don't want to use localizations.

  • 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
Sign in to follow this  

×