Gameplay::setForcePlayerToJump
Client-Side Function
JavaScript Syntax
Set the player to be forced into jump state, should be called in render as it works per frame.
Required Params
- handle: number
Return value
- void
Syntax
mp.game.gameplay.setForcePlayerToJump(handle)
Example
let playerJumping = true;
//force player to jump
mp.events.add('render', () => {
if (playerJumping) mp.game.gameplay.setForcePlayerToJump(mp.players.local.handle);
})
//stop making the player jump after 5 seconds
setTimeout(() => {
playerJumping = false;
}, 5000)