Advertisement
Guest User

Untitled

a guest
May 20th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. /*
  2. /*
  3. File: fn_jumpFnc.sqf
  4. Author: Bryan "Tonic" Boardwine
  5.  
  6. Description:
  7. Makes the target jump.
  8. */
  9. private ["_unit","_vel","_dir","_v1","_v2","_anim","_oldpos"];
  10. _unit = [_this,0,objNull,[objNull]] call BIS_fnc_param;
  11. _oldpos = getPosATL _unit;
  12.  
  13. if (isNull _unit) exitWith {}; //Bad data
  14.  
  15. if (animationState _unit == "AovrPercMrunSrasWrflDf") exitWith {};
  16.  
  17. if (local _unit) then {
  18. _v1 = 3.82;
  19. _v2 = .4;
  20. _dir = direction player;
  21. _vel = velocity _unit;
  22. _unit setVelocity[(_vel select 0)+(sin _dir*_v2),(_vel select 1)+(cos _dir*_v2),(_vel select 2)+_v1];
  23. };
  24.  
  25. _anim = animationState _unit;
  26. _unit switchMove "AovrPercMrunSrasWrflDf";
  27.  
  28. if (local _unit) then {
  29. waitUntil {
  30. if ((getPos _unit select 2) > 4) then {
  31. _unit setposATL _oldpos;
  32. _unit setVelocity [0, 0, 0];
  33. };
  34. animationState _unit != "AovrPercMrunSrasWrflDf"
  35. };
  36. _unit switchMove _anim;
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement