|
Member
|
07-16-2011
, 07:25
Re: search longjump
|
#4
|
I haven't tested it but it should work (it's part of my other plugin)
The delay between long jumps can be changed via cvar.
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#define PLUGIN "Long Jump"
#define VERSION "1.0"
#define AUTHOR "Zabijaka"
new Float:gPlayers[33];
new gCvarDelay;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_CmdStart, "CmdStart");
gCvarDelay = register_cvar("long_jump_delay", "10.0");
}
public CmdStart(id, uc_handle)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
new button = get_uc(uc_handle, UC_Buttons);
new flags = get_entity_flags(id);
new Float: gametime = get_gametime();
if(button & IN_JUMP && button & IN_DUCK && flags & FL_ONGROUND &&
gametime > gPlayers[id] + get_pcvar_float(gCvarDelay)){
gPlayers[id] = gametime;
new Float:velocity[3];
VelocityByAim(id, 700, velocity);
velocity[2] = random_float(265.0,285.0);
entity_set_vector(id, EV_VEC_velocity, velocity);
}
return FMRES_IGNORED;
}
|
|
|
|