Try it out ( untested )
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fun >
#include < cstrike >
#pragma semicolon 1
#define MAX_PLAYERS 32
#define KILLS_REQUIRED 12
#define PLUGIN "Ultra Awp"
#define VERSION "2.0a"
new g_iKills[ MAX_PLAYERS + 1 ];
new g_iMenu;
public plugin_init( ) {
register_plugin( PLUGIN, VERSION, "maqi" );
RegisterHam( Ham_TakeDamage, "player", "Event_PlayerTakeDamagePre", 0 );
RegisterHam( Ham_Killed, "player", "Event_PlayerKilledPost", 1 );
CreateAwpMenu( );
}
public Event_PlayerTakeDamagePre( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits ) {
if( !is_user_alive( iAttacker ) )
return HAM_IGNORED;
if( !HasAwp( iAttacker ) )
return HAM_IGNORED;
static iWeapon; iWeapon = get_user_weapon( iAttacker );
if( iWeapon != CSW_AWP )
return HAM_IGNORED;
SetHamParamFloat( 4, fDamage * 2 );
return HAM_OVERRIDE;
}
public Event_PlayerKilledPost( iVictim, iKiller, iShouldGib ) {
if( !is_user_alive( iKiller ) )
return;
g_iKills[ iVictim ] = 0;
if( HasAwp( iKiller ) )
return;
if( ++g_iKills[ iKiller ] >= KILLS_REQUIRED )
menu_display( iKiller, g_iMenu );
}
GiveAwp( iIndex ) {
if( !is_user_alive( iIndex ) )
return;
give_item( iIndex, "weapon_awp" );
cs_set_user_bpammo( iIndex, CSW_AWP, 30 );
}
CreateAwpMenu( ) {
g_iMenu = menu_create( "Would you like the ultra AWP ?", "Handler_MenuAwp" );
menu_additem( g_iMenu, "YES" );
menu_additem( g_iMenu, "NO" );
}
public Handler_MenuAwp( iIndex, iMenu, iItem ) {
if( iItem == 0 )
GiveAwp( iIndex );
return PLUGIN_HANDLED;
}
static bool:HasAwp( const iIndex ) {
return ( g_iKills[ iIndex ] >= KILLS_REQUIRED && user_has_weapon( iIndex, CSW_AWP ) );
}
__________________