Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ---------------
- Author: Veticus;
- ---------------
- Function: Repo Script;
- ---------------
- */
- // Addaction;
- Repo_Action1 = player addAction ["<t color='#FF0000' size='1.1'>[Repo Vehicle]", {[] call AL_fnc_Vehicle_RepoMain;}, "true"]; // addAction to call script.
- // Variables;
- AL_RepoMan = 0; // Changed to "1" when becomes repo-man job.
- AL_RepoVehicle = 0; // Changes to "1" when vehicle is being towed.
- // Main Function;
- ["AL_fnc_Vehicle_RepoMain", {
- private ["_RepoTruckSelect", "_RepoTruckNearest", "_VehicleSelect"];
- _RepoTruckSelect = nearestObjects [player, ["AL_RepoTruck"], 5];
- _RepoTruckNearest = getPos player nearestObject "AL_RepoTruck";
- _VehicleSelect = cursorTarget;
- if (isNil "AL_RepoMan") exitWith {};
- if (isNil "AL_RepoVehicle") exitWith {};
- if (_VehicleSelect in playableUnits) exitWith {};
- if (_VehicleSelect distance player > 3 || (_VehicleSelect isKindOf "Man")) exitWith {};
- if (AL_RepoMan == 1) then {
- if (AL_RepoVehicle == 0) then {
- _VehicleSelect attachTo [_RepoTruckNearest, [0, -8, -.55]];
- ["Repo: Vehicle Attached", AL_MsgColor_Red] call AL_Msg_Hint;
- AL_RepoVehicle = 1;
- } else {
- detach _VehicleSelect;
- _VehicleSelect setVectorUp [0, 0, 1];
- _VehicleSelect setPosATL [getPosATL _VehicleSelect select 0, getPosATL _VehicleSelect select 1, 0];
- ["Repo: Vehicle Detached", AL_MsgColor_Red] call AL_Msg_Hint;
- AL_RepoVehicle = 0;
- };
- };
- }] call AL_fnc;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement