for everyone who need such plugin as Im making for my MOD
here it is. thanks to all
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
new const Version[] = "0.1";
new pcvar_jumpimpulse;
new snd_jump[][] = { "quad/jump.wav" }
new snd_land[][] = { "quad/land1.wav" }
const BUTTONS = ( IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT | IN_JUMP );
new g_OffGround , g_LandEntity , g_iMaxPlayers;
public plugin_init()
{
register_plugin( "Hook Landing" , Version , "bugsy" );
register_forward( FM_CmdStart , "fw_FMCmdStart" );
pcvar_jumpimpulse = register_cvar("hj_impulse", "385");
g_iMaxPlayers = get_maxplayers();
}
public plugin_precache() {
static i
for(i = 0; i < sizeof snd_jump; i++)
precache_sound(snd_jump[i])
for(i = 0; i < sizeof snd_land; i++)
precache_sound(snd_land[i])
}
public fw_FMCmdStart( id , uc_handle , seed )
{
if ( ( get_uc( uc_handle , UC_Buttons ) | pev( id , pev_oldbuttons ) ) & BUTTONS )
{
if ( !( pev( id , pev_flags ) & FL_ONGROUND ) )
{
g_OffGround |= ( 1 << ( id & 31 ) );
if ( !g_LandEntity )
CreateLandEntity();
entity_set_float( g_LandEntity , EV_FL_nextthink , get_gametime() + 0.01 );
}
}
if ((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP) && (pev(id, pev_flags) & FL_ONGROUND))
{
new Float:velocity[3];
pev(id, pev_velocity, velocity)
velocity[2] = get_pcvar_float(pcvar_jumpimpulse);
set_pev(id, pev_velocity, velocity)
client_cmd(id,"play quad/jump")
}
}
public LandEntityThink( iEntity )
{
for ( new id = 1 ; id <= g_iMaxPlayers ; id++ )
{
if ( g_OffGround & ( 1 << ( id & 31 ) ) )
{
if ( pev( id , pev_flags ) & FL_ONGROUND )
{
emit_sound(id, CHAN_BODY, snd_land[random_num(0, sizeof snd_land - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
g_OffGround &= ~( 1 << ( id & 31 ) );
if ( !g_OffGround )
break;
}
}
}
if ( g_OffGround )
entity_set_float( g_LandEntity , EV_FL_nextthink , get_gametime() + 0.01 );
}
CreateLandEntity()
{
g_LandEntity = create_entity( "info_target" );
entity_set_string( g_LandEntity , EV_SZ_classname , "land_entity" );
register_think( "land_entity" , "LandEntityThink" );
}
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc