Hello all please solve my problem.
Im trying to make pple jump
bigger & longer jumps by pressing the normal jump key (spacebar). I need to to be Higher and longer , not just higher , not just longer alone , to the direction where the player is aiming (crosshair).
Serached and found people only making higherjumps or giving longjump module , I dont want longjump module =/
Using this code I jump higher and longer but not in the direction of where my crosshair is , pls point out to me my errors.
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
public plugin_init()
{
register_plugin("Hugejump","1.0","DS_ToP_GunNeR")
register_forward(FM_PlayerPreThink,"FM_PreThink")
}
public FM_PreThink(id)
{
if((pev(id,pev_button) & IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))
{
if(!(pev(id,pev_oldbuttons) & IN_JUMP))
{
new Float: velocity[3]
new Float: origin[3]
velocity_by_aim(id, 800, origin)
velocity[0] += origin[0] + 1000
velocity[1] += origin[1] + 1000
velocity[2] += origin[2] + 500
entity_set_vector(id,EV_VEC_velocity,velocity)
return PLUGIN_HANDLED
}
}
return PLUGIN_HANDLED
}