我初一看 还以为你是自己写的
原来也是转的别人的插件#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
new P_Cvars
new Weapons
public plugin_init()
{
register_plugin("Fire Rate Control", "1.01", "Fxfighter")
register_event("CurWeapon","Event_CurWeapon", "b")
P_Cvars = register_cvar("amx_fr","1")
P_Cvars = register_cvar("amx_fr_p228","1.0")
P_Cvars = register_cvar("amx_fr_scout","1.0")
P_Cvars = register_cvar("amx_fr_hegrenade","1.0")
P_Cvars = register_cvar("amx_fr_xm1014","1.0")
P_Cvars = register_cvar("amx_fr_all","1.0")
P_Cvars = register_cvar("amx_fr_mac10","1.0")
P_Cvars = register_cvar("amx_fr_aug","1.0")
P_Cvars = register_cvar("amx_fr_smokegrenade","1.0")
P_Cvars = register_cvar("amx_fr_elite","1.0")
P_Cvars = register_cvar("amx_fr_fiveseven","1.0")
P_Cvars = register_cvar("amx_fr_ump45","1.0")
P_Cvars = register_cvar("amx_fr_sg550","1.0")
P_Cvars = register_cvar("amx_fr_galil","1.0")
P_Cvars = register_cvar("amx_fr_famas","1.0")
P_Cvars = register_cvar("amx_fr_usp","1.0")
P_Cvars = register_cvar("amx_fr_glock18","1.0")
P_Cvars = register_cvar("amx_fr_awp","1.0")
P_Cvars = register_cvar("amx_fr_mp5navy","1.0")
P_Cvars = register_cvar("amx_fr_m249","1.0")
P_Cvars = register_cvar("amx_fr_m3","1.0")
P_Cvars = register_cvar("amx_fr_m4a1","1.0")
P_Cvars = register_cvar("amx_fr_tmp","1.0")
P_Cvars = register_cvar("amx_fr_g3sg1","1.0")
P_Cvars = register_cvar("amx_fr_flashbang","1.0")
P_Cvars = register_cvar("amx_fr_deagle","1.0")
P_Cvars = register_cvar("amx_fr_sg552","1.0")
P_Cvars = register_cvar("amx_fr_ak47","1.0")
P_Cvars = register_cvar("amx_fr_p90","1.0")
}
public Event_CurWeapon(id)
{
new Gun = read_data(2)
new On = get_pcvar_num(P_Cvars)
if( On == 0 || Gun==0 || Gun==6 || Gun==29 || Gun>30)
return PLUGIN_CONTINUE
new Ammo = read_data(3)
if(Weapons == Gun && Weapons <= Ammo)
{
Weapons = Ammo
return PLUGIN_CONTINUE
}
Weapons = Gun
Weapons = Ammo
new Float:N_Speed
if(On == 1)
N_Speed = get_pcvar_float(P_Cvars)
else
N_Speed = get_pcvar_float(P_Cvars)
if(N_Speed != 1.0)
{
new weapon
get_weaponname(Gun,weapon,31)
new Ent = fm_find_ent_by_owner(-1,weapon,id)
if(Ent)
{
new Float:Delay = get_pdata_float( Ent, 46, 4) * N_Speed
if (Delay > 0.0)
set_pdata_float( Ent, 46, Delay, 4)
}
}
return PLUGIN_CONTINUE
}
//Frome Fakemeta utility
stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0)
{
new strtype = "classname", ent = index
switch (jghgtype)
{
case 1: strtype = "target"
case 2: strtype = "targetname"
}
while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}
return ent
}
页:
1
[2]