hi,
Can anyone help me put this only for VIPs with Flag b?
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <amxmisc>
#include <engine>
#define PLUGIN "Reload Speed"
#define AUTHOR "ConnorMcLeod"
#define VERSION "1.0.0"
#define ADMINACCESS ADMIN_RESERVATION
const NOCLIP_WPN_BS= ((1<<2)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENA DE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW _C4))
const SHOTGUNS_BS= ((1<<CSW_M3)|(1<<CSW_XM1014))
const m_pPlayer= 41
const m_fInReload= 54
const m_flNextAttack= 83
new gmsgBarTime2
new g_pCvarReloadSpeed, g_pCvarReloadBar
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pCvarReloadSpeed = register_cvar("amx_reload_speed", "0.2",ADMIN_ADMIN)
g_pCvarReloadBar = register_cvar("amx_reload_bar", "1",ADMIN_ADMIN)
new szWeapon[17]
for(new i=1; i<=CSW_P90; i++)
{
if(!( NOCLIP_WPN_BS & (1<<i) )
&&!( SHOTGUNS_BS & (1<<i) )
&&get_weaponname(i, szWeapon, charsmax(szWeapon)) )
{
RegisterHam(Ham_Weapon_Reload, szWeapon, "Weapon_Reload", 1)
RegisterHam(Ham_Item_Holster, szWeapon, "Item_Holster")
}
}
gmsgBarTime2 = get_user_msgid("BarTime2")
}
public Weapon_Reload( iEnt )
{
if( get_pdata_int(iEnt, m_fInReload, 4) )
{
new id = get_pdata_cbase(iEnt, m_pPlayer, 4) && (!access(iEnt,ADMINACCESS))
new Float:flNextAttack = get_pdata_float(id, m_flNextAttack, 5) * get_pcvar_float(g_pCvarReloadSpeed)
set_pdata_float(id, m_flNextAttack, flNextAttack, 5)
if( get_pcvar_num(g_pCvarReloadBar) && (!access(iEnt,ADMINACCESS)))
{
new iSeconds = floatround(flNextAttack, floatround_ceil)
Make_BarTime2(id, iSeconds, 100 - floatround( (flNextAttack/iSeconds) * 100 ))
}
}
}
public Item_Holster( iEnt )
{
if( get_pdata_int(iEnt, m_fInReload, 4) && (!access(iEnt,ADMINACCESS)))
{
Make_BarTime2(get_pdata_cbase(iEnt, m_pPlayer, 4), 0, 0)
}
}
Make_BarTime2(id, iSeconds, iPercent)
{
message_begin(MSG_ONE_UNRELIABLE, gmsgBarTime2, _, id)
write_short(iSeconds)
write_short(iPercent)
message_end()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\
*/
thanks
|