#include < amxmodx >
#include < amxmodx >
#include < hamsandwich >
#include < fakemeta >
#define _PLUGIN "Addon: Multi-Jump"
#define _VERSION "1.1"
#define _AUTHOR "H.RED.ZONE"
#define ADMIN_FLAG ADMIN_LEVEL_H
new _gJumpCount[33]
new _pCvarMultiJumpAdminAmount
,_pCvarMultiJumpPlayerAmount
public plugin_init() {
register_plugin( _PLUGIN, _VERSION, _AUTHOR )
_pCvarMultiJumpAdminAmount = register_cvar( "multijump_admin_amount", "6" )
_pCvarMultiJumpPlayerAmount = register_cvar( "multijump_player_amount", "2" )
RegisterHam( Ham_Player_Jump, "player", "_FW_Player_Jump", 0 )
}
public _FW_Player_Jump( id ) {
if( is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG ) {
new Flags = pev( id, pev_flags )
if( Flags & FL_WATERJUMP
|| pev(id, pev_waterlevel) >= 2
|| !(get_pdata_int(id, 246) & IN_JUMP) ){
return HAM_IGNORED
}
if( Flags & FL_ONGROUND ) {
_gJumpCount[ id ] = 0
return HAM_IGNORED
}
new Multi = get_pcvar_num( _pCvarMultiJumpAdminAmount )
if( Multi ) {
if( get_pdata_float(id, 251) < 500
&& ++_gJumpCount[id] <= Multi ) {
new Float:fVelocity[ 3 ]
pev( id, pev_velocity, fVelocity )
fVelocity[ 2 ] = 268.328157
set_pev( id, pev_velocity, fVelocity )
return HAM_HANDLED
}
}
}
else {
new Flags = pev( id, pev_flags )
if( Flags & FL_WATERJUMP
|| pev(id, pev_waterlevel) >= 2
|| !(get_pdata_int(id, 246) & IN_JUMP) ){
return HAM_IGNORED
}
if( Flags & FL_ONGROUND ) {
_gJumpCount[ id ] = 0
return HAM_IGNORED
}
new Multi = get_pcvar_num( _pCvarMultiJumpPlayerAmount )
if( Multi ) {
if( get_pdata_float(id, 251) < 500
&& ++_gJumpCount[id] <= Multi ) {
// Set Velocity.
new Float:fVelocity[ 3 ]
pev( id, pev_velocity, fVelocity )
fVelocity[ 2 ] = 268.328157
set_pev( id, pev_velocity, fVelocity )
return HAM_HANDLED
}
}
}
return HAM_IGNORED
}