Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isNull player) exitwith {} ;
- fn_jump_Animation =
- {
- private ["_unit", "_anim", "_weap"];
- _unit = _this select 0;
- _anim = _this select 1;
- _weap = primaryWeapon _unit;//remember weapon
- _unit switchMove _anim;// PLAY ANIMATION JUMP
- if(currentWeapon _unit != _weap) then {
- sleep 0.6;
- _unit selectWeapon _weap;
- _unit switchMove "";
- };
- };
- jump_keyDown={
- private ["_r", "_key_delay", "_max_height"] ;
- _actionKey = 46;
- _key_delay = 0.3;// MAX TIME BETWEEN KEY PRESSES
- _max_height = 4.3;// SET MAX JUMP HEIGHT
- // player setvariable ["key",false];// ENABLE THIS LINE FOR SINGLE KEYPRESS BY REMOVING // AT THE START OF THE LINE
- _r = false;
- // HINT STR (_this select 1);// show key number
- // VARIOUS CHECKS
- if (player getvariable["key", true] && (_this select 1) == _actionKey) exitwith {
- player setvariable["key", false];
- [_key_delay] spawn {
- sleep (_this select 0);
- player setvariable["key", true];
- };
- _r
- };
- _speed = speed player;
- if ((_this select 1) == _actionKey && _speed>8) then {
- if (
- player == vehicle player &&
- player getvariable ["jump", true] &&
- isTouchingGround player
- ) then {
- player setvariable["key", true];// RESTE DOUBLE KEY TAP
- player setvariable["jump", false];// DISABLE JUMP
- _height = 6-((load player)*10);// REDUCE HEIGHT BASED ON WEIGHT
- //hint str _height;
- // MAKE JUMP IN RIGHT DIRECTION
- _vel = velocity player;
- _dir = direction player;
- If (_height > _max_height) then { // MAXIMUM HEIGHT OF JUMP
- _height = _max_height
- };
- player setVelocity [
- (_vel select 0)+(sin _dir*_speed),
- (_vel select 1)+(cos _dir*_speed),
- (_vel select 2)+_height
- ];
- [[player, "AovrPercMrunSrasWrflDf"], "fn_Animation", true, false] spawn BIS_fnc_MP; //BROADCAST ANIMATION
- player spawn { // RE-ENABLE JUMP
- sleep 2;
- _this setvariable ["jump", true]
- };
- };
- _r=true;
- };
- _r;
- } ;
- waituntil {!(isNull (findDisplay 46))};
- (findDisplay 46) displayAddEventHandler ["keydown", "_this call jump_keyDown"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement