[Help] Vehicle Repair Script

robob27

New Member
Hey there,

I recently started adding some scripts to our Vilayer server at the request of my friends. I managed to get Krixes self bloodbag mod going, and using the same structure I tried to write one of my own. Now neither mod works. I'm sure I could revert everything and it would all be fine, but I'm hoping it's something easy to fix.


Edit: I played around more and now the bloodbag thing isn't an issue, it's working fine again, but I can't get the vehicle repair function to work still :(


Edit 2: I edited the scripts more, I think I'm getting closer but still no dice..


Edit 3: Played around more and finally got it. Yay for me :p.

fn_selfActions.sqf:

Code:
if (_isVehicle and (damage cursorTarget < 1)) then {
_vehicle = cursorTarget;
dayz_myRepairTarget = _vehicle;
if(s_player_dirtyrepair < 0) then {
s_player_dirtyrepair = dayz_myRepairTarget addAction ["<t color=""#c70000"">" + ("Dirty Repair") +"</t>", "custom\player_dirtyrepair.sqf", _vehicle, 0, true, true, "",""];
};
} else {
dayz_myRepairTarget removeAction s_player_dirtyrepair;
s_player_dirtyrepair = -1;
};

player_dirtyrepair.sqf:



Code:
private["_vehicle"];
_vehicle = _this select 3;
_vehicle removeAction s_player_dirtyrepair;
_vehicle setDamage 0;

Figured I'd leave it here in case anyone else was interested. This is my first attempt at writing a mod thing and I'm pretty happy with my success :).

Thanks!
 
Back
Top