Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.42 KB | None | 0 0
  1. /*
  2. ---------------
  3. Author: Veticus;
  4. ---------------
  5. Function: Repo Script;
  6. ---------------
  7. */
  8.  
  9. // Addaction;
  10. Repo_Action1 = player addAction ["<t color='#FF0000' size='1.1'>[Repo Vehicle]", {[] call AL_fnc_Vehicle_RepoMain;}, "true"]; // addAction to call script.
  11.  
  12. // Variables;
  13. AL_RepoMan = 0; // Changed to "1" when becomes repo-man job.
  14. AL_RepoVehicle = 0; // Changes to "1" when vehicle is being towed.
  15.  
  16. // Main Function;
  17. ["AL_fnc_Vehicle_RepoMain", {
  18.     private ["_RepoTruckSelect", "_RepoTruckNearest", "_VehicleSelect"];
  19.     _RepoTruckSelect = nearestObjects [player, ["AL_RepoTruck"], 5];
  20.     _RepoTruckNearest = getPos player nearestObject "AL_RepoTruck";
  21.     _VehicleSelect = cursorTarget;
  22.     if (isNil "AL_RepoMan") exitWith {};
  23.     if (isNil "AL_RepoVehicle") exitWith {};
  24.     if (_VehicleSelect in playableUnits) exitWith {};
  25.     if (_VehicleSelect distance player > 3 || (_VehicleSelect isKindOf "Man")) exitWith {};
  26.     if (AL_RepoMan == 1) then {
  27.         if (AL_RepoVehicle == 0) then {
  28.             _VehicleSelect attachTo [_RepoTruckNearest, [0, -8, -.55]];
  29.             ["Repo: Vehicle Attached", AL_MsgColor_Red] call AL_Msg_Hint;
  30.             AL_RepoVehicle = 1;
  31.         } else {
  32.             detach _VehicleSelect;
  33.             _VehicleSelect setVectorUp [0, 0, 1];
  34.             _VehicleSelect setPosATL [getPosATL _VehicleSelect select 0, getPosATL _VehicleSelect select 1, 0];
  35.             ["Repo: Vehicle Detached", AL_MsgColor_Red] call AL_Msg_Hint;
  36.             AL_RepoVehicle = 0;
  37.         };
  38.     }; 
  39. }] call AL_fnc;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement