PHP Code:
#include <amxmodx>
#include <engine>
#include <fun>
new const Float: g_fMaxSpeed[] =
{
250.0, //no weapon
250.0, //p228
0.0, //shield
260.0, //scout
250.0, //hegrenade
240.0, //xm1014
250.0, //c4
250.0, //mac10
240.0, //aug
250.0, //smoke
250.0, //elite
250.0, //fiveseven
250.0, //ump45
210.0, //sg550
240.0, //galil
240.0, //famas
250.0, //usp
250.0, //glock
210.0, //awp
250.0, //mp5navy
220.0, //m249
230.0, //m3
230.0, //m4a1
250.0, //tmp
210.0, //g3sg1
250.0, //flash
250.0, //deagle
235.0, //sg552
221.0, //ak47
250.0, //knife
245.0 //p90
};
new bool: g_bHoney[ 33 ];
new g_iCurWeapon[ 33 ];
public plugin_init()
{
register_plugin( "honey" , "1.0" , "bugsy" );
register_event( "CurWeapon" , "fw_CurWeapon" , "be" , "1=1" );
register_clcmd( "say /honey" , "DoHoney" );
register_clcmd( "say /removehoney" , "RemoveHoney" );
}
public fw_CurWeapon( id )
{
static iWeapon; iWeapon = read_data( 2 );
if ( g_bHoney[ id ] && ( g_iCurWeapon[ id ] != iWeapon ) )
{
set_user_maxspeed( id , 50.0 );
g_iCurWeapon[ id ] = iWeapon;
}
}
public DoHoney( id )
{
static Float:vVelocity[ 3 ];
if ( !g_bHoney[ id ] )
{
entity_get_vector( id , EV_VEC_velocity , vVelocity );
vVelocity[0] = vVelocity[0] / 2.0;
vVelocity[1] = vVelocity[1] / 2.0;
entity_set_vector( id , EV_VEC_velocity , vVelocity );
set_user_maxspeed( id , 50.0 );
g_bHoney[ id ] = true;
}
}
public RemoveHoney( id )
{
if ( g_bHoney[ id ] )
{
g_bHoney[ id ] = false;
set_user_maxspeed( id , g_fMaxSpeed[ get_user_weapon( id ) ] );
}
}
__________________