Raised This Month: $ Target: $400
 0% 

search longjump


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
e12harry
Member
Join Date: Apr 2010
Old 07-16-2011 , 07:25   Re: search longjump
Reply With Quote #1

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;
}
e12harry is offline
ttoxic
Junior Member
Join Date: Jul 2011
Old 07-16-2011 , 09:57   Re: search longjump
Reply With Quote #2

thx, all ok
ttoxic is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode