Попробуй
Code
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "No Recoil"
#define VERSION "1.0"
#define AUTHOR "Pike & brigada alliedmods"
#define MAXPLAYERS 32
#define RECOIL 4
new g_nCurWeapon[MAXPLAYERS+1][2]
new Float:recoil_LastAng[MAXPLAYERS+1][3]
new userDetections[MAXPLAYERS+1][5]
new g_MaxPlayers
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event( "CurWeapon", "No_recoil", "b" )
set_task(1.0,"ClearRecoil",128,_,_,"b")
}
public No_Recoil(id)
{
new Float:aim[3]
new weaponID = read_data( 2 )
new wAmmo = read_data( 3 )
entity_get_vector(id,EV_VEC_angles,aim)
if( g_nCurWeapon[id-1][0] != weaponID ) // User Changed Weapons..
{
g_nCurWeapon[id-1][0] = weaponID
g_nCurWeapon[id-1][1] = wAmmo
return PLUGIN_CONTINUE
}
if( g_nCurWeapon[id-1][1] < wAmmo ) // User Reloaded..
{
g_nCurWeapon[id-1][1] = wAmmo
return PLUGIN_CONTINUE
}
if( g_nCurWeapon[id-1][1] == wAmmo ) // User did something else, but didn't shoot..
return PLUGIN_CONTINUE
g_nCurWeapon[id-1][1] = wAmmo
g_nCurWeapon[id-1][0] = weaponID
if (weaponID == CSW_HEGRENADE
|| weaponID == CSW_SMOKEGRENADE
|| weaponID == CSW_FLASHBANG
|| weaponID == CSW_KNIFE
|| weaponID == CSW_C4
|| weaponID == CSW_GLOCK18) {
return PLUGIN_HANDLED
}else{
if((aim[0]==recoil_LastAng[id][0] && recoil_LastAng[id][0]!=0))
{
userDetections[id][RECOIL]++
}else{
userDetections[id][RECOIL]--
}
recoil_LastAng[id][0]=aim[0]
if (userDetections[id][RECOIL] > 10)
cheatDetected(id,RECOIL)
}
return PLUGIN_CONTINUE
}
public client_connect(id)
{
userDetections[id][RECOIL] = 0
}
public ClearRecoil()
{
for(new i=0;i<=g_MaxPlayers;i++)
{
userDetections[i][RECOIL] = userDetections[i][RECOIL] - 10
if (userDetections[i][RECOIL] < 0)
userDetections[i][RECOIL] = 0
}
}
public cheatDetected(id, rcode)
{
new name[32]
new ip[32], reason[64]
new authid[32],map[32]
get_user_name(id, name, 31)
get_user_ip(id, ip, 31, 1)
get_user_authid(id, authid, 31)
get_mapname(map,31)
if (rcode==RECOIL)
reason = "Norecoil hack"
server_cmd("kick #%d [Anti-Cheats] %s", get_user_userid(id), reason)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/