Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. if (isNull player) exitwith {} ;
  2.  
  3. fn_Animation =
  4. {
  5. _unit = _this select 0;
  6. _anim = _this select 1;
  7. _unit switchMove _anim;// PLAY ANIMATION JUMP
  8. //_unit playMovenow _anim;
  9. };
  10.  
  11. dokeyDown={
  12. private ["_r","_key_delay","_max_height"] ;
  13. _key_delay = 0.3;// MAX TIME BETWEEN KEY PRESSES
  14. _max_height = 4.3;// SET MAX JUMP HEIGHT
  15. player setvariable ["key",false];// ENABLE THIS LINE FOR SINGLE KEYPRESS BY REMOVING // AT THE START OF THE LINE
  16. _r = false ;
  17.  
  18. // HINT STR (_this select 1);// show key number
  19.  
  20. // VARIOUS CHECKS
  21. if (player getvariable["key",true] and (_this select 1) == 57) exitwith {player setvariable["key",false]; [_key_delay] spawn {sleep (_this select 0);player setvariable["key",true]; };_r};
  22. if ((_this select 1) == 57 and speed player >8) then {
  23. if (player == vehicle player and player getvariable ["jump",true] and isTouchingGround player ) then {
  24.  
  25. player setvariable["key",true];// RESTE DOUBLE KEY TAP
  26. player setvariable ["jump",false];// DISABLE JUMP
  27.  
  28. _height = 6-((load player)*1);// REDUCE HEIGHT BASED ON WEIGHT
  29. //hint str _height;
  30.  
  31. // MAKE JUMP IN RIGHT DIRECTION
  32. _vel = velocity player;
  33. _dir = direction player;
  34. _speed = 0.4;
  35. If (_height > _max_height) then {_height = _max_height};// MAXIMUM HEIGHT OF JUMP
  36. player setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),(_vel select 2)+_height];
  37.  
  38. [[player,"AovrPercMrunSrasWrflDf"],"fn_Animation",nil,false] spawn BIS_fnc_MP; //BROADCAST ANIMATION
  39. player spawn {sleep 2;_this setvariable ["jump",true]};// RE-ENABLE JUMP
  40.  
  41. };
  42. _r=true;
  43. };
  44. _r;
  45. } ;
  46.  
  47. waituntil {!(IsNull (findDisplay 46))};
  48. (FindDisplay 46) displayAddEventHandler ["keydown","_this call dokeyDown"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement