Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. //Default BattleBus Vehicle not set
  2. _car = objNull;
  3.  
  4. TC_BB_removeBus = {
  5. _car = missionNamespace setVariable ["battleVic", objNull];
  6. };
  7.  
  8. TC_BB_addBus = {
  9. params["_selectedVehicle"];
  10. _car = missionNamespace setVariable ["battleVic", _selectedVehicle];
  11. player addAction["Remove Selected Vehicle", "call TC_BB_removeBus"];
  12.  
  13. };
  14.  
  15. //Object Placement Controller, BATTLE BUS SYSTEM ATTACHED
  16. TC_ObjectHandler = ["acex_fortify_objectPlaced", {
  17. params ["_player", "_side", "_objectplaced"];
  18. //Only run for player
  19. if !(local _player) exitWith {};
  20.  
  21. _car = missionNamespace getVariable ["battleVic"];
  22.  
  23.  
  24. //If the object is a turret weapon, then don't simplify it.
  25. //In the current set up static weapons can't be attached to vehicles, I want weapons to be attachable to vics
  26. if (_objectplaced isKindOf 'RHS_M2StaticMG_D' or _objectplaced isKindOf 'RHS_TOW_TriPod_D') exitWith {};
  27.  
  28. //If there is a value for vehicle, then attach objects relative to that.
  29. if !(isNull _car) exitWith {
  30. [_objectplaced, _car] call BIS_fnc_attachToRelative;
  31. };
  32.  
  33. //Any object placed that is not a turret or attached to a vehicle should be replaced with a simple object.
  34. if !(isNull _objectplaced) exitWith {
  35.  
  36. //This Does NOT work
  37. systemchat str _objectplaced;
  38. private _ObjLoc = getPOSASL _objectplaced;
  39. deleteVehicle _objectplaced;
  40. createSimpleObject [_objectplaced,_ObjLoc];
  41.  
  42. //This works, but objects don't get placed exactly where they should.
  43. //[_objectplaced] call BIS_fnc_replaceWithSimpleObject;
  44. };
  45. }] call cba_fnc_addEventhandler;
  46.  
  47. //Slap this on vehicle that can be selectable for a Battle Bus
  48. // _action = ["BBSelect","Battle Bus Select Vehicle","Hair128x128.paa",{[_this] call TC_BB_addBus},{true},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement