JohnO1985

Untitled

Jan 12th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.76 KB | None | 0 0
  1. /**
  2.  * ExileClient_object_trader_create
  3.  * Modified*****
  4.  * Exile Mod
  5.  * www.exilemod.com
  6.  * © 2015 Exile Mod Team
  7.  *
  8.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  */
  11.  
  12. private["_traderClassName","_traderFace","_animations","_position","_direction","_attachToObject","_trader","_animationCount"];
  13. _traderClassName = _this select 0;
  14. _traderFace = _this select 1;
  15. _animations = _this select 2;
  16. _position = _this select 3;
  17. _direction = _this select 4;
  18. _attachToObject = [_this, 5, objNull] call BIS_fnc_param;
  19. _trader = _traderClassName createVehicle [0,0,0];
  20. _trader setVariable ["BIS_enableRandomization", false];
  21. _trader setVariable ["BIS_fnc_animalBehaviour_disable", true];
  22. _trader disableAI "ANIM";
  23. _trader disableAI "MOVE";
  24. _trader disableAI "FSM";
  25. _trader disableAI "AUTOTARGET";
  26. _trader disableAI "TARGET";
  27. _trader disableAI "CHECKVISIBLE";
  28. _trader allowDamage false;
  29. _trader removeAllEventHandlers "HandleDamage";
  30. _trader setFace _traderFace;
  31. if (isNull _attachToObject) then
  32. {
  33.     _attachToObject = "Logic" createVehicle[0, 0, 0];
  34.     _attachToObject setPosATL _position;
  35.     _position = [0, 0, 0];
  36. };
  37. _trader reveal _attachToObject;
  38. _attachToObject disableCollisionWith _trader;        
  39. _trader disableCollisionWith _attachToObject;
  40. _trader attachTo [_attachToObject, _position];
  41. _trader setDir _direction;
  42. _trader switchMove (_animations select 0);
  43. _animationCount = count _animations;
  44. if (_animationCount > 1) then
  45. {
  46.     _trader setVariable ["ExileAnimations", _animations];
  47.     _trader addEventHandler ["AnimDone", {_this call ExileClient_object_trader_event_onAnimationDone}];
  48. };
  49. _trader
Advertisement
Add Comment
Please, Sign In to add comment