[Snippet] Longjump

Started by aXXo, Aug 01, 2015, 01:37 PM

Previous topic - Next topic

aXXo

While trying to add player's speed as a drug effect, I realized that player.Speed only works when a player is not colliding against anything. It only works when a player is in mid-air. As soon as you touch the ground(or any other collision), the speed changes to default as per GTA:VC physics.

Speedhacks did not become a reality, but here is a snippet that makes the player jump higher. This is very inconsistent in a crowded server due to performance issues, but the code and the idea can be implemented.

Code
Pastebin

Usage
To enable a player's longjump, create an instance of the CLongjump class. Parameter: player instance.
Example:
function onPlayerSpawn( player )
{
     local pLongjump = CLongjump( player );
}