•  
     

fast_sniper_switch - Deixa a awp mais rapida

Este plugin traz de volta o velho recurso do CS 1.5.
Você é capaz de disparar uma bala com awp e mudar para faca ou qualquer outra arma muito rápido.

Código: Selecionar todos


//Delay for awp fast switch (in cs1.5 it was 0.75 like any other weapon)
#define AWP_SWITCH_DELAY 0.75 // default: 0.75

//Delay for scout fast switch (in cs1.5 it was 0.75 like any other weapon)
#define SCOUT_SWITCH_DELAY 0.75 // default: 0.75

//Comment next line if you don't want people to be notified about the plugin
#define PLUGIN_NOTIFICATION // default: uncommented


#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN_NAME	"Fast Sniper Switch"
#define PLUGIN_VERSION	"1.3"
#define PLUGIN_AUTHOR	"Numb"

#define m_pPlayer               41  // (weapon_*) owner entity
#define m_iId                   43  // (weapon_*) type of weapon CSW_
#define m_flNextPrimaryAttack   46  // (weapon_*) next prim attack
#define m_flNextSecondaryAttack 47  // (weapon_*) next sec attack
#define m_flDecreaseShotsFired  76  // (weapon_*) ??? right after Deploy has same value as get_gametime()
#define m_flNextAttack          83  // (player) next attack
#define m_pActiveItem           373 // (player) active weapon

public plugin_init()
{
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
	
	RegisterHam(Ham_Item_Deploy, "weapon_awp",   "Ham_Item_Deploy_Post", 1);
	RegisterHam(Ham_Item_Deploy, "weapon_scout", "Ham_Item_Deploy_Post", 1);
	
#if defined PLUGIN_NOTIFICATION
	register_event("WeapPickup", "Event_WeapPickup", "be", "1=18"); // CSW_AWP
	register_event("WeapPickup", "Event_WeapPickup", "be", "1=3");  // CSW_SCOUT
#endif
}

#if defined PLUGIN_NOTIFICATION
public Event_WeapPickup(iPlrId)
	client_print(iPlrId, print_center, "%s%cis active", PLUGIN_NAME, 13);
#endif

public Ham_Item_Deploy_Post(iEnt)
{
	if( !pev_valid(iEnt) )
		return HAM_IGNORED;
	
	new iPlrId = get_pdata_cbase(iEnt, m_pPlayer, 4);
	if( !is_user_alive(iPlrId) )
		return HAM_IGNORED;
	
	if( iEnt!=get_pdata_cbase(iPlrId, m_pActiveItem, 5) || get_pdata_float(iEnt, m_flDecreaseShotsFired, 4)!=get_gametime() )
		return HAM_IGNORED;
	
	switch( get_pdata_int(iEnt, m_iId, 4) )
	{
		case CSW_AWP:
		{
			set_pdata_float(iEnt, m_flNextPrimaryAttack, AWP_SWITCH_DELAY, 4);
			set_pdata_float(iEnt, m_flNextSecondaryAttack, AWP_SWITCH_DELAY, 4);
			set_pdata_float(iPlrId, m_flNextAttack, AWP_SWITCH_DELAY, 5);
		}
		case CSW_SCOUT:
		{
			set_pdata_float(iEnt, m_flNextPrimaryAttack, SCOUT_SWITCH_DELAY, 4);
			set_pdata_float(iEnt, m_flNextSecondaryAttack, SCOUT_SWITCH_DELAY, 4);
			set_pdata_float(iPlrId, m_flNextAttack, SCOUT_SWITCH_DELAY, 5);
		}
	}
	
	return HAM_IGNORED;
}


fast_sniper_switch.amxx
(3.57 KiB) Transferido 165 vezes

fast_sniper_switch.sma
(3.73 KiB) Transferido 118 vezes