Diff
checker
टेक्स्ट
टेक्स्ट
छवियां
दस्तावेज़
Excel
फ़ोल्डर्स
Legal
Enterprise
डेस्कटॉप
मूल्य
साइन इन करें
Diffchecker डेस्कटॉप डाउनलोड करें
टेक्स्ट की तुलना करें
दो टेक्स्ट फ़ाइलों के बीच अंतर ढूंढें
उपकरण
इतिहास
रियल-टाइम एडिटर
रिक्त स्थान छिपाएँ
अपरिवर्तित संक्षिप्त करें
लाइन रैप बंद
लेआउट
विभाजित
संयुक्त
परिवर्तन हाइलाइट करें
स्मार्ट
शब्द
अक्षर
टेक्स्ट शैलियां
दिखावट बदलें
सिंटैक्स हाइलाइटिंग
सिंटैक्स चुनें
अनदेखा करें
टेक्स्ट बदलें
पहले अंतर पर जाएँ
इनपुट संपादित करें
Diffchecker Desktop
Diffchecker चलाने का सबसे सुरक्षित तरीका। Diffchecker Desktop ऐप पाएं: आपके diffs कभी आपके कंप्यूटर से बाहर नहीं जाते!
Desktop पाएं
AMXX4U reaimdetector
बनाया गया
3 वर्ष पहले
Diff कभी समाप्त नहीं होता
साफ़
निर्यात करें
शेयर करें
समझाएं
526 हटाए गए
लाइनें
कुल
हटाया गया
अक्षर
कुल
हटाया गया
इस सुविधा का उपयोग जारी रखने के लिए, अपग्रेड करें
Diff
checker
Pro
मूल्य देखें
776 लाइनें
सभी को कॉपी करें
537 जोड़े गए
लाइनें
कुल
जोड़ा गया
अक्षर
कुल
जोड़ा गया
इस सुविधा का उपयोग जारी रखने के लिए, अपग्रेड करें
Diff
checker
Pro
मूल्य देखें
782 लाइनें
सभी को कॉपी करें
#include <amxmodx>
#include <amxmodx>
#include <reaimdetector>
#include <reaimdetector>
#pragma semicolon 1
#pragma semicolon 1
#if !defined MAX_PLAYERS
#if !defined MAX_PLAYERS
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
#define MAX_PLAYERS
32
#define MAX_PLAYERS
32
#endif
#endif
#if defined client_disconnected
#if defined client_disconnected
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
#define player_disconnect client_disconnected
#define player_disconnect client_disconnected
#else
#else
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
#define player_disconnect client_disconnect
#define player_disconnect client_disconnect
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
#define ENABLE_LOG_FILE
// Включить логирование
#define ENABLE_LOG_FILE
// Включить логирование
#define RELOAD_CMD
ADMIN_
CFG
// Флаг доступа к команде перезагрузки конфига: reaim_reloadcfg
#define RELOAD_CMD
ADMIN_
IMMUNITY
// Флаг доступа к команде перезагрузки конфига: reaim_reloadcfg
#define MENU_CMD
ADMIN_
BAN
// Флаг доступа к Aim меню: say /aim
#define MENU_CMD
ADMIN_
IMMUNITY
// Флаг доступа к Aim меню: say /aim
new const reAIMPrefix[] = "^4[ReAim]^1";
new const NSDPrefix[] = "^4[NSD]^1";
enum CfgType
enum CfgType
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
AIM = 1,
AIM = 1,
SPREAD,
SPREAD,
PUNISH,
PUNISH,
SAVE,
SAVE,
OTHER
OTHER
}
}
#if (AMXX_VERSION_NUM < 183)
#if (AMXX_VERSION_NUM < 183)
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
enum
enum
{
{
print_team_default = 0,
print_team_default = 0,
print_team_grey = -1,
print_team_grey = -1,
print_team_red = -2,
print_team_red = -2,
print_team_blue = -3
print_team_blue = -3
};
};
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
#define replace_string replace_all
#define replace_string replace_all
#endif
#endif
new Trie:g_tAimBotSteamWarns, Trie:g_tAimBotIpWarns;
new Trie:g_tAimBotSteamWarns, Trie:g_tAimBotIpWarns;
new Trie:g_tNoSpreadSteamWarns, Trie:g_tNoSpreadIpWarns;
new Trie:g_tNoSpreadSteamWarns, Trie:g_tNoSpreadIpWarns;
new g_iAimDetection, g_iAimSens, g_iAimMultiWarn, g_iAimNotify, g_iAimMaxWarns, g_iAimShotsReset, g_iAimKillsReset, g_iAimTimeReset;
new g_iAimDetection, g_iAimSens, g_iAimMultiWarn, g_iAimNotify, g_iAimMaxWarns, g_iAimShotsReset, g_iAimKillsReset, g_iAimTimeReset;
new g_iSaveType, g_iAimSaveWarns, g_iSpreadSaveWarns;
new g_iSaveType, g_iAimSaveWarns, g_iSpreadSaveWarns;
new g_iSpreadDetection, g_iSpreadNotify, g_iSpreadMaxWarns;
new g_iSpreadDetection, g_iSpreadNotify, g_iSpreadMaxWarns;
new g_iAlertFlag;
new g_iAlertFlag;
new g_iSendProtectionWeapon;
new g_iSendProtectionWeapon;
new g_iCrashCheat;
new g_iCrashCheat;
new g_iBanTime[PunishType];
new g_iBanTime[PunishType];
new g_szBanReason[PunishType][64];
new g_szBanReason[PunishType][64];
new g_szBanString[PunishType][128];
new g_szBanString[PunishType][128];
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new g_FilePath[64], g_LogDir[128];
new g_FilePath[64], g_LogDir[128];
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
static const configs_file[] = "addons_configs/amxx4u/antycheat/reaimdetector.ini";
public plugin_init()
public plugin_init()
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
register_plugin("ReAimDetector API", REAIMDETECTOR_VERSION, "ReHLDS Team
");
register_plugin("ReAimDetector API", REAIMDETECTOR_VERSION, "ReHLDS Team
& NewITVision", "https://amxx4u.pl/
");
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
register_concmd("reaim_reloadcfg", "ReloadCfg",
RELOAD_CMD
);
register_concmd("reaim_reloadcfg", "ReloadCfg",
ADMIN_IMMUNITY
);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
register_clcmd("say /aim", "AimMenu", MENU_CMD);
register_clcmd("say /aim", "AimMenu", MENU_CMD);
register_clcmd("say_team /aim", "AimMenu", MENU_CMD);
register_clcmd("say_team /aim", "AimMenu", MENU_CMD);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
g_tAimBotSteamWarns = TrieCreate();
g_tAimBotSteamWarns = TrieCreate();
g_tAimBotIpWarns = TrieCreate();
g_tAimBotIpWarns = TrieCreate();
g_tNoSpreadSteamWarns = TrieCreate();
g_tNoSpreadSteamWarns = TrieCreate();
g_tNoSpreadIpWarns = TrieCreate();
g_tNoSpreadIpWarns = TrieCreate();
}
}
public plugin_end()
public plugin_end()
{
{
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new Map[32], BufLog[64];
new Map[32], BufLog[64];
get_mapname(Map, charsmax(Map));
get_mapname(Map, charsmax(Map));
formatex(BufLog, charsmax(BufLog), "End Map [%s]", Map);
formatex(BufLog, charsmax(BufLog), "End Map [%s]", Map);
SaveLogFile(BufLog);
SaveLogFile(BufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
TrieClear(g_tAimBotSteamWarns);
TrieClear(g_tAimBotSteamWarns);
TrieClear(g_tAimBotIpWarns);
TrieClear(g_tAimBotIpWarns);
TrieClear(g_tNoSpreadSteamWarns);
TrieClear(g_tNoSpreadSteamWarns);
TrieClear(g_tNoSpreadIpWarns);
TrieClear(g_tNoSpreadIpWarns);
}
}
public client_putinserver(id)
public client_putinserver(id)
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
switch(g_iSaveType)
switch(g_iSaveType)
{
{
case 1:
case 1:
{
{
new szSteam[33], iWarns;
new szSteam[33], iWarns;
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_authid(id, szSteam, charsmax(szSteam));
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szBufLog[190], szAddress[17], szName[32];
new szBufLog[190], szAddress[17], szName[32];
get_user_ip(id, szAddress, charsmax(szAddress), 1);
get_user_ip(id, szAddress, charsmax(szAddress), 1);
get_user_name(id, szName, charsmax(szName));
get_user_name(id, szName, charsmax(szName));
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(TrieKeyExists(g_tAimBotSteamWarns, szSteam))
if(TrieKeyExists(g_tAimBotSteamWarns, szSteam))
{
{
TrieGetCell(g_tAimBotSteamWarns, szSteam, iWarns);
TrieGetCell(g_tAimBotSteamWarns, szSteam, iWarns);
TrieDeleteKey(g_tAimBotSteamWarns, szSteam);
TrieDeleteKey(g_tAimBotSteamWarns, szSteam);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(id, AimWarn, iWarns);
ad_set_client(id, AimWarn, iWarns);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(TrieKeyExists(g_tNoSpreadSteamWarns, szSteam))
if(TrieKeyExists(g_tNoSpreadSteamWarns, szSteam))
{
{
TrieGetCell(g_tNoSpreadSteamWarns, szSteam, iWarns);
TrieGetCell(g_tNoSpreadSteamWarns, szSteam, iWarns);
TrieDeleteKey(g_tNoSpreadSteamWarns, szSteam);
TrieDeleteKey(g_tNoSpreadSteamWarns, szSteam);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(id, NoSpreadWarn, iWarns);
ad_set_client(id, NoSpreadWarn, iWarns);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
}
}
case 2:
case 2:
{
{
new szAddress[17], iWarns;
new szAddress[17], iWarns;
get_user_ip(id, szAddress, charsmax(szAddress), 1);
get_user_ip(id, szAddress, charsmax(szAddress), 1);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szBufLog[190], szSteam[33], szName[32];
new szBufLog[190], szSteam[33], szName[32];
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_name(id, szName, charsmax(szName));
get_user_name(id, szName, charsmax(szName));
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(TrieKeyExists(g_tAimBotIpWarns, szAddress))
if(TrieKeyExists(g_tAimBotIpWarns, szAddress))
{
{
TrieGetCell(g_tAimBotIpWarns, szAddress, iWarns);
TrieGetCell(g_tAimBotIpWarns, szAddress, iWarns);
TrieDeleteKey(g_tAimBotIpWarns, szAddress);
TrieDeleteKey(g_tAimBotIpWarns, szAddress);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(id, AimWarn, iWarns);
ad_set_client(id, AimWarn, iWarns);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(TrieKeyExists(g_tNoSpreadIpWarns, szAddress))
if(TrieKeyExists(g_tNoSpreadIpWarns, szAddress))
{
{
TrieGetCell(g_tNoSpreadIpWarns, szAddress, iWarns);
TrieGetCell(g_tNoSpreadIpWarns, szAddress, iWarns);
TrieDeleteKey(g_tNoSpreadIpWarns, szAddress);
TrieDeleteKey(g_tNoSpreadIpWarns, szAddress);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(id, NoSpreadWarn, iWarns);
ad_set_client(id, NoSpreadWarn, iWarns);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
}
}
case 3:
case 3:
{
{
new szSteam[33], szAddress[17], iWarns;
new szSteam[33], szAddress[17], iWarns;
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_ip(id, szAddress, charsmax(szAddress), 1);
get_user_ip(id, szAddress, charsmax(szAddress), 1);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szBufLog[190], szName[32];
new szBufLog[190], szName[32];
get_user_name(id, szName, charsmax(szName));
get_user_name(id, szName, charsmax(szName));
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new bool:IsExistsAim = false;
new bool:IsExistsAim = false;
new bool:IsExistsSpread = false;
new bool:IsExistsSpread = false;
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(TrieKeyExists(g_tAimBotSteamWarns, szSteam))
if(TrieKeyExists(g_tAimBotSteamWarns, szSteam))
{
{
IsExistsAim = true;
IsExistsAim = true;
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
TrieGetCell(g_tAimBotSteamWarns, szSteam, iWarns);
TrieGetCell(g_tAimBotSteamWarns, szSteam, iWarns);
TrieDeleteKey(g_tAimBotSteamWarns, szSteam);
TrieDeleteKey(g_tAimBotSteamWarns, szSteam);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(id, AimWarn, iWarns);
ad_set_client(id, AimWarn, iWarns);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(TrieKeyExists(g_tAimBotIpWarns, szAddress))
if(TrieKeyExists(g_tAimBotIpWarns, szAddress))
{
{
if(IsExistsAim)
if(IsExistsAim)
{
{
TrieDeleteKey(g_tAimBotIpWarns, szAddress);
TrieDeleteKey(g_tAimBotIpWarns, szAddress);
}
}
else
else
{
{
TrieGetCell(g_tAimBotIpWarns, szAddress, iWarns);
TrieGetCell(g_tAimBotIpWarns, szAddress, iWarns);
TrieDeleteKey(g_tAimBotIpWarns, szAddress);
TrieDeleteKey(g_tAimBotIpWarns, szAddress);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(id, AimWarn, iWarns);
ad_set_client(id, AimWarn, iWarns);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(TrieKeyExists(g_tNoSpreadSteamWarns, szSteam))
if(TrieKeyExists(g_tNoSpreadSteamWarns, szSteam))
{
{
IsExistsSpread = true;
IsExistsSpread = true;
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
TrieGetCell(g_tNoSpreadSteamWarns, szSteam, iWarns);
TrieGetCell(g_tNoSpreadSteamWarns, szSteam, iWarns);
TrieDeleteKey(g_tNoSpreadSteamWarns, szSteam);
TrieDeleteKey(g_tNoSpreadSteamWarns, szSteam);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(id, NoSpreadWarn, iWarns);
ad_set_client(id, NoSpreadWarn, iWarns);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(TrieKeyExists(g_tNoSpreadIpWarns, szAddress))
if(TrieKeyExists(g_tNoSpreadIpWarns, szAddress))
{
{
if(IsExistsSpread)
if(IsExistsSpread)
{
{
TrieDeleteKey(g_tNoSpreadIpWarns, szAddress);
TrieDeleteKey(g_tNoSpreadIpWarns, szAddress);
}
}
else
else
{
{
TrieGetCell(g_tNoSpreadIpWarns, szAddress, iWarns);
TrieGetCell(g_tNoSpreadIpWarns, szAddress, iWarns);
TrieDeleteKey(g_tNoSpreadIpWarns, szAddress);
TrieDeleteKey(g_tNoSpreadIpWarns, szAddress);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(id, NoSpreadWarn, iWarns);
ad_set_client(id, NoSpreadWarn, iWarns);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
}
}
}
}
}
}
}
}
public player_disconnect(id)
public player_disconnect(id)
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
switch(g_iSaveType)
switch(g_iSaveType)
{
{
case 1:
case 1:
{
{
new szSteam[33];
new szSteam[33];
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_authid(id, szSteam, charsmax(szSteam));
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new iAimBotWarns = ad_get_client(id, AimWarn);
new iAimBotWarns = ad_get_client(id, AimWarn);
new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn);
new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(iAimBotWarns >= g_iAimSaveWarns)
if(iAimBotWarns >= g_iAimSaveWarns)
{
{
TrieSetCell(g_tAimBotSteamWarns, szSteam, iAimBotWarns);
TrieSetCell(g_tAimBotSteamWarns, szSteam, iAimBotWarns);
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(iNoSpreadWarns >= g_iSpreadSaveWarns)
if(iNoSpreadWarns >= g_iSpreadSaveWarns)
{
{
TrieSetCell(g_tNoSpreadSteamWarns, szSteam, iNoSpreadWarns);
TrieSetCell(g_tNoSpreadSteamWarns, szSteam, iNoSpreadWarns);
}
}
}
}
case 2:
case 2:
{
{
new szAddress[17];
new szAddress[17];
get_user_ip(id, szAddress, charsmax(szAddress), 1);
get_user_ip(id, szAddress, charsmax(szAddress), 1);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new iAimBotWarns = ad_get_client(id, AimWarn);
new iAimBotWarns = ad_get_client(id, AimWarn);
new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn);
new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(iAimBotWarns >= g_iAimSaveWarns)
if(iAimBotWarns >= g_iAimSaveWarns)
{
{
TrieSetCell(g_tAimBotIpWarns, szAddress, iAimBotWarns);
TrieSetCell(g_tAimBotIpWarns, szAddress, iAimBotWarns);
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(iNoSpreadWarns >= g_iSpreadSaveWarns)
if(iNoSpreadWarns >= g_iSpreadSaveWarns)
{
{
TrieSetCell(g_tNoSpreadIpWarns, szAddress, iNoSpreadWarns);
TrieSetCell(g_tNoSpreadIpWarns, szAddress, iNoSpreadWarns);
}
}
}
}
case 3:
case 3:
{
{
new szSteam[33], szAddress[17];
new szSteam[33], szAddress[17];
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_ip(id, szAddress, charsmax(szAddress), 1);
get_user_ip(id, szAddress, charsmax(szAddress), 1);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new iAimBotWarns = ad_get_client(id, AimWarn);
new iAimBotWarns = ad_get_client(id, AimWarn);
new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn);
new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(iAimBotWarns >= g_iAimSaveWarns)
if(iAimBotWarns >= g_iAimSaveWarns)
{
{
TrieSetCell(g_tAimBotSteamWarns, szSteam, iAimBotWarns);
TrieSetCell(g_tAimBotSteamWarns, szSteam, iAimBotWarns);
TrieSetCell(g_tAimBotIpWarns, szAddress, iAimBotWarns);
TrieSetCell(g_tAimBotIpWarns, szAddress, iAimBotWarns);
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(iNoSpreadWarns >= g_iSpreadSaveWarns)
if(iNoSpreadWarns >= g_iSpreadSaveWarns)
{
{
TrieSetCell(g_tNoSpreadSteamWarns, szSteam, iNoSpreadWarns);
TrieSetCell(g_tNoSpreadSteamWarns, szSteam, iNoSpreadWarns);
TrieSetCell(g_tNoSpreadIpWarns, szAddress, iNoSpreadWarns);
TrieSetCell(g_tNoSpreadIpWarns, szAddress, iNoSpreadWarns);
}
}
}
}
}
}
}
}
public ReloadCfg(id, level, cid)
public ReloadCfg(id, level, cid)
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(~get_user_flags(id) & level) {
if(~get_user_flags(id) & level) {
return PLUGIN_CONTINUE;
return PLUGIN_CONTINUE;
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ReadCfg();
ReadCfg();
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
client_print(id, print_console, "[Aim Detector]: Reload Cfg.");
client_print(id, print_console, "[Aim Detector]: Reload Cfg.");
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
return PLUGIN_HANDLED;
return PLUGIN_HANDLED;
}
}
public AimMenu(id, level)
public AimMenu(id, level)
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(~get_user_flags(id) & level) {
if(~get_user_flags(id) & level) {
return PLUGIN_CONTINUE;
return PLUGIN_CONTINUE;
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
static iPlayers[32], iNum, i, iPlayer;
static iPlayers[32], iNum, i, iPlayer;
get_players(iPlayers, iNum, "ch");
get_players(iPlayers, iNum, "ch");
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szName[32], szInfo[3], szTempString[96];
new szName[32], szInfo[3], szTempString[96];
new iMenu = menu_create("\wAim Detector
Меню
", "AimMenuHandler");
new iMenu = menu_create("\wAim Detector
menu
", "AimMenuHandler");
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new bool:bFindPlayer = false;
new bool:bFindPlayer = false;
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
for(i = 0; i < iNum; i++)
for(i = 0; i < iNum; i++)
{
{
iPlayer = iPlayers[i];
iPlayer = iPlayers[i];
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new iAimBotWarns = ad_get_client(iPlayer, AimWarn);
new iAimBotWarns = ad_get_client(iPlayer, AimWarn);
new iNoSpreadWarns = ad_get_client(iPlayer, NoSpreadWarn);
new iNoSpreadWarns = ad_get_client(iPlayer, NoSpreadWarn);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(iAimBotWarns == 0 && iNoSpreadWarns == 0) {
if(iAimBotWarns == 0 && iNoSpreadWarns == 0) {
continue;
continue;
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
bFindPlayer = true;
bFindPlayer = true;
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
get_user_name(iPlayer, szName, charsmax(szName));
get_user_name(iPlayer, szName, charsmax(szName));
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szTempString, charsmax(szTempString), "\w%s \r[\yAim\r: \w%d\r|\yNoSpread\r: \w%d\r]", szName, iAimBotWarns, iNoSpreadWarns);
formatex(szTempString, charsmax(szTempString), "\w%s \r[\yAim\r: \w%d\r|\yNoSpread\r: \w%d\r]", szName, iAimBotWarns, iNoSpreadWarns);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
num_to_str(iPlayer, szInfo, charsmax(szInfo));
num_to_str(iPlayer, szInfo, charsmax(szInfo));
menu_additem(iMenu, szTempString, szInfo);
menu_additem(iMenu, szTempString, szInfo);
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(bFindPlayer)
if(bFindPlayer)
{
{
menu_setprop(iMenu, MPROP_NUMBER_COLOR, "\r");
menu_setprop(iMenu, MPROP_NUMBER_COLOR, "\r");
menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL);
menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL);
menu_setprop(iMenu, MPROP_EXITNAME, "Выход");
menu_setprop(iMenu, MPROP_EXITNAME, "Выход");
menu_setprop(iMenu, MPROP_NEXTNAME, "Далее");
menu_setprop(iMenu, MPROP_NEXTNAME, "Далее");
menu_setprop(iMenu, MPROP_BACKNAME, "Назад");
menu_setprop(iMenu, MPROP_BACKNAME, "Назад");
menu_display(id, iMenu);
menu_display(id, iMenu);
}
}
else
else
{
{
new szBufNotify[190];
new szBufNotify[190];
formatex(szBufNotify, charsmax(szBufNotify), "
^1[^4Aim Detector^1] ^3Список ^1в ^4меню ^3пустой
^1."
);
formatex(szBufNotify, charsmax(szBufNotify), "
%s Lista w menu jest^4 pusta
^1."
, reAIMPrefix
);
client_print_color(id, print_team_default, szBufNotify);
client_print_color(id, print_team_default, szBufNotify);
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
return PLUGIN_HANDLED;
return PLUGIN_HANDLED;
}
}
public AimMenuHandler(id, menu, item)
public AimMenuHandler(id, menu, item)
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if (item == MENU_EXIT)
if (item == MENU_EXIT)
{
{
menu_destroy(menu);
menu_destroy(menu);
return PLUGIN_HANDLED;
return PLUGIN_HANDLED;
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new iAccess, szInfo[3], iCallback;
new iAccess, szInfo[3], iCallback;
menu_item_getinfo(menu, item, iAccess, szInfo, charsmax(szInfo), .callback = iCallback);
menu_item_getinfo(menu, item, iAccess, szInfo, charsmax(szInfo), .callback = iCallback);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new iPlayer = str_to_num(szInfo);
new iPlayer = str_to_num(szInfo);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new iAimWarn = ad_get_client(iPlayer, AimWarn);
new iAimWarn = ad_get_client(iPlayer, AimWarn);
new iSpreadWarn = ad_get_client(iPlayer, NoSpreadWarn);
new iSpreadWarn = ad_get_client(iPlayer, NoSpreadWarn);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szBufNotify[190], szName[32];
new szBufNotify[190], szName[32];
get_user_name(iPlayer, szName, charsmax(szName));
get_user_name(iPlayer, szName, charsmax(szName));
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufNotify, charsmax(szBufNotify), "
^1[^4Aim Detector^1] ^3
Name
^1[^4 %s ^1] ^3
AimWarn
^1[^4 %d ^1] ^3
NoSpreadWarn
^1[^4 %d ^1]"
, szName, iAimWarn, iSpreadWarn);
formatex(szBufNotify, charsmax(szBufNotify), "
%s
Name
^4[%s]^1
AimWarn
^4[%d]^1
NoSpreadWarn
^4[%d]^1", reAIMPrefix
, szName, iAimWarn, iSpreadWarn);
client_print_color(id, print_team_default, szBufNotify);
client_print_color(id, print_team_default, szBufNotify);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
return PLUGIN_HANDLED;
return PLUGIN_HANDLED;
}
}
public ad_init(const Version[], const Map[])
public ad_init(const Version[], const Map[])
{
{
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
get_localinfo("amxx_logs", g_FilePath, charsmax(g_FilePath));
get_localinfo("amxx_logs", g_FilePath, charsmax(g_FilePath));
formatex(g_LogDir, charsmax(g_LogDir), "%s
/reaimdetector
", g_FilePath);
formatex(g_LogDir, charsmax(g_LogDir), "%s
", g_FilePath);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(!dir_exists(g_LogDir))
if(!dir_exists(g_LogDir))
{
{
mkdir(g_LogDir);
mkdir(g_LogDir);
}
}
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ReadCfg();
ReadCfg();
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szBufLog[190];
new szBufLog[190];
formatex(szBufLog, charsmax(szBufLog), "Start Map [%s] AimSens [%d] AimMaxWarns [%d] NoSpreadNotifyWarns [%d] NoSpreadMaxWarns [%d]",
formatex(szBufLog, charsmax(szBufLog), "Start Map [%s] AimSens [%d] AimMaxWarns [%d] NoSpreadNotifyWarns [%d] NoSpreadMaxWarns [%d]",
Map, ad_get_cfg(AimSens), g_iAimMaxWarns, ad_get_cfg(NoSpreadNotifyWarns), g_iSpreadMaxWarns);
Map, ad_get_cfg(AimSens), g_iAimMaxWarns, ad_get_cfg(NoSpreadNotifyWarns), g_iSpreadMaxWarns);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
}
}
public ad_notify(const index, const PunishType:pType, const NotifyType:nType, const Kills, const Shots, const Warn)
public ad_notify(const index, const PunishType:pType, const NotifyType:nType, const Kills, const Shots, const Warn)
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szBufNotify[190], szName[32];
new szBufNotify[190], szName[32];
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szBufLog[190], szAddress[22], szSteam[33];
new szBufLog[190], szAddress[22], szSteam[33];
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
get_user_ip(index, szAddress, charsmax(szAddress));
get_user_ip(index, szAddress, charsmax(szAddress));
get_user_authid(index, szSteam, charsmax(szSteam));
get_user_authid(index, szSteam, charsmax(szSteam));
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
get_user_name(index, szName, charsmax(szName));
get_user_name(index, szName, charsmax(szName));
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(pType == AIMBOT)
if(pType == AIMBOT)
{
{
if(nType == WARNING && Warn > g_iAimNotify)
if(nType == WARNING && Warn > g_iAimNotify)
{
{
formatex(szBufNotify, charsmax(szBufNotify), "
^1[^4Aim Detector^1] ^3Name ^1[
^4 %s
^1] ^3Warn ^1[
^4 %d
^1] ^3MaxWarn ^1[
^4 %d
^1]"
, szName, Warn, g_iAimMaxWarns);
formatex(szBufNotify, charsmax(szBufNotify), "
%s Nick:
^4 %s
^1 | Ostrzerzenie:
^4 %d
^1 | Max ostrzezen:
^4 %d
^1", reAIMPrefix
, szName, Warn, g_iAimMaxWarns);
Send_Notify_Admins(index, szBufNotify);
Send_Notify_Admins(index, szBufNotify);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Add: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn);
formatex(szBufLog, charsmax(szBufLog), "Aim Warn Add: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
else if(nType == DETECT)
else if(nType == DETECT)
{
{
formatex(szBufNotify, charsmax(szBufNotify), "
^1[^4Aim Detector^1] ^3Name ^1[
^4 %s
^1] ^3
Detected"
, szName);
formatex(szBufNotify, charsmax(szBufNotify), "
%s Nick:
^4 %s
^3
Detected"
, reAIMPrefix
, szName);
Send_Notify_Admins(index, szBufNotify);
Send_Notify_Admins(index, szBufNotify);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "Aim Detected: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn);
formatex(szBufLog, charsmax(szBufLog), "Aim Detected: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(index, AimCheck, 0);
ad_set_client(index, AimCheck, 0);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
PunishPlayer(index, AIMBOT);
PunishPlayer(index, AIMBOT);
}
}
}
}
else if(pType == NOSPREAD)
else if(pType == NOSPREAD)
{
{
if(nType == WARNING && Warn > g_iSpreadNotify)
if(nType == WARNING && Warn > g_iSpreadNotify)
{
{
formatex(szBufNotify, charsmax(szBufNotify), "
^1[^4NoSpread Detector^1] ^3Name ^1[
^4 %s
^1] ^3Warn ^1[
^4 %d
^1]"
, szName, Warn, g_iSpreadMaxWarns);
formatex(szBufNotify, charsmax(szBufNotify), "
%s Nick
^4 %s
^1 | Ostrzezenie^4 %d^1 | Max ostrzezen
^4 %d
^1", NSDPrefix
, szName, Warn, g_iSpreadMaxWarns);
Send_Notify_Admins(index, szBufNotify);
Send_Notify_Admins(index, szBufNotify);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Add: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn);
formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Add: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
else if(nType == DETECT)
else if(nType == DETECT)
{
{
formatex(szBufNotify, charsmax(szBufNotify), "
^1[^4NoSpread Detector^1] ^3Name ^1[
^4 %s
^1] ^3
Detected"
, szName);
formatex(szBufNotify, charsmax(szBufNotify), "
%s Nick
^4 %s
^3
Detected"
, NSDPrefix
, szName);
Send_Notify_Admins(index, szBufNotify);
Send_Notify_Admins(index, szBufNotify);
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szBufLog, charsmax(szBufLog), "NoSpread Detected: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn);
formatex(szBufLog, charsmax(szBufLog), "NoSpread Detected: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
#endif
#endif
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_client(index, NoSpreadCheck, 0);
ad_set_client(index, NoSpreadCheck, 0);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
PunishPlayer(index, NOSPREAD);
PunishPlayer(index, NOSPREAD);
}
}
}
}
}
}
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
public ad_aim_reset_warn(const index, const ResetType:rType, const Kills, const Shots)
public ad_aim_reset_warn(const index, const ResetType:rType, const Kills, const Shots)
{
{
new szBufLog[190], szName[32], szAddress[22], szSteam[33];
new szBufLog[190], szName[32], szAddress[22], szSteam[33];
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
get_user_name(index, szName, charsmax(szName));
get_user_name(index, szName, charsmax(szName));
get_user_ip(index, szAddress, charsmax(szAddress));
get_user_ip(index, szAddress, charsmax(szAddress));
get_user_authid(index, szSteam, charsmax(szSteam));
get_user_authid(index, szSteam, charsmax(szSteam));
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
switch(rType)
switch(rType)
{
{
case KILLED:
case KILLED:
{
{
formatex(szBufLog, charsmax(szBufLog), "Killed Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills + 1, Shots);
formatex(szBufLog, charsmax(szBufLog), "Killed Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills + 1, Shots);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
}
}
case SHOTS:
case SHOTS:
{
{
formatex(szBufLog, charsmax(szBufLog), "Shots Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills, Shots + 1);
formatex(szBufLog, charsmax(szBufLog), "Shots Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills, Shots + 1);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
}
}
case TIME:
case TIME:
{
{
formatex(szBufLog, charsmax(szBufLog), "Time Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills, Shots);
formatex(szBufLog, charsmax(szBufLog), "Time Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills, Shots);
SaveLogFile(szBufLog);
SaveLogFile(szBufLog);
}
}
}
}
}
}
#endif
#endif
stock ReadCfg()
stock ReadCfg()
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szFilePath[
64
];
new szFilePath[
256
];
get_localinfo("amxx_configsdir", szFilePath, charsmax(szFilePath));
get_localinfo("amxx_configsdir", szFilePath, charsmax(szFilePath));
formatex(szFilePath, charsmax(szFilePath), "%s/
reaimdetector.ini
", szFilePath
);
formatex(szFilePath, charsmax(szFilePath), "%s/
%s
", szFilePath
, configs_file
);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new FileHandle = fopen(szFilePath, "rt");
new FileHandle = fopen(szFilePath, "rt");
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(!FileHandle)
if(!FileHandle)
{
{
set_fail_state("Error load cfg.");
set_fail_state("Error load cfg.");
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szTemp[256], szKey[32], szValue[512], iSection;
new szTemp[256], szKey[32], szValue[512], iSection;
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
while(!feof(FileHandle))
while(!feof(FileHandle))
{
{
fgets(FileHandle, szTemp, charsmax(szTemp));
fgets(FileHandle, szTemp, charsmax(szTemp));
trim(szTemp);
trim(szTemp);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if (szTemp[0] == '[')
if (szTemp[0] == '[')
{
{
iSection++;
iSection++;
continue;
continue;
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(!szTemp[0] || szTemp[0] == ';' || szTemp[0] == '/') {
if(!szTemp[0] || szTemp[0] == ';' || szTemp[0] == '/') {
continue;
continue;
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
strtok(szTemp, szKey, charsmax(szKey), szValue, charsmax(szValue), '=');
strtok(szTemp, szKey, charsmax(szKey), szValue, charsmax(szValue), '=');
trim(szKey);
trim(szKey);
trim(szValue);
trim(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
switch(iSection)
switch(iSection)
{
{
case AIM:
case AIM:
{
{
if(equal(szKey, "AIM_DETECTION"))
if(equal(szKey, "AIM_DETECTION"))
g_iAimDetection = str_to_num(szValue);
g_iAimDetection = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "SENS"))
else if(equal(szKey, "SENS"))
g_iAimSens = str_to_num(szValue);
g_iAimSens = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "MULTI_WARN"))
else if(equal(szKey, "MULTI_WARN"))
g_iAimMultiWarn = str_to_num(szValue);
g_iAimMultiWarn = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "NOTIFY_WARNS"))
else if(equal(szKey, "NOTIFY_WARNS"))
g_iAimNotify = str_to_num(szValue);
g_iAimNotify = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "MAX_WARNS"))
else if(equal(szKey, "MAX_WARNS"))
g_iAimMaxWarns = str_to_num(szValue);
g_iAimMaxWarns = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "SHOTS_RESET"))
else if(equal(szKey, "SHOTS_RESET"))
g_iAimShotsReset = str_to_num(szValue);
g_iAimShotsReset = str_to_num(szValue);
else if(equal(szKey, "KILLS_RESET"))
else if(equal(szKey, "KILLS_RESET"))
g_iAimKillsReset = str_to_num(szValue);
g_iAimKillsReset = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "TIME_RESET"))
else if(equal(szKey, "TIME_RESET"))
g_iAimTimeReset = str_to_num(szValue);
g_iAimTimeReset = str_to_num(szValue);
}
}
case SPREAD:
case SPREAD:
{
{
if(equal(szKey, "NOSPREAD_DETECTION"))
if(equal(szKey, "NOSPREAD_DETECTION"))
g_iSpreadDetection = str_to_num(szValue);
g_iSpreadDetection = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "NOTIFY_WARNS"))
else if(equal(szKey, "NOTIFY_WARNS"))
g_iSpreadNotify = str_to_num(szValue);
g_iSpreadNotify = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "MAX_WARNS"))
else if(equal(szKey, "MAX_WARNS"))
g_iSpreadMaxWarns = str_to_num(szValue);
g_iSpreadMaxWarns = str_to_num(szValue);
}
}
case PUNISH:
case PUNISH:
{
{
if(equal(szKey, "REASON_AIMBOT"))
if(equal(szKey, "REASON_AIMBOT"))
copy(g_szBanReason[AIMBOT], charsmax(g_szBanReason[]), szValue);
copy(g_szBanReason[AIMBOT], charsmax(g_szBanReason[]), szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "BAN_TIME_AIMBOT"))
else if(equal(szKey, "BAN_TIME_AIMBOT"))
g_iBanTime[AIMBOT] = str_to_num(szValue);
g_iBanTime[AIMBOT] = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "REASON_NOSPREAD"))
else if(equal(szKey, "REASON_NOSPREAD"))
copy(g_szBanReason[NOSPREAD], charsmax(g_szBanReason[]), szValue);
copy(g_szBanReason[NOSPREAD], charsmax(g_szBanReason[]), szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "BAN_TIME_NOSPREAD"))
else if(equal(szKey, "BAN_TIME_NOSPREAD"))
g_iBanTime[NOSPREAD] = str_to_num(szValue);
g_iBanTime[NOSPREAD] = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "PUNISH_AIMBOT"))
else if(equal(szKey, "PUNISH_AIMBOT"))
copy(g_szBanString[AIMBOT], charsmax(g_szBanString[]), szValue);
copy(g_szBanString[AIMBOT], charsmax(g_szBanString[]), szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "PUNISH_NOSPREAD"))
else if(equal(szKey, "PUNISH_NOSPREAD"))
copy(g_szBanString[NOSPREAD], charsmax(g_szBanString[]), szValue);
copy(g_szBanString[NOSPREAD], charsmax(g_szBanString[]), szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
}
}
case SAVE:
case SAVE:
{
{
if(equal(szKey, "TYPE"))
if(equal(szKey, "TYPE"))
g_iSaveType = str_to_num(szValue);
g_iSaveType = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "AIM_WARNS"))
else if(equal(szKey, "AIM_WARNS"))
g_iAimSaveWarns = str_to_num(szValue);
g_iAimSaveWarns = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "NOSPREAD_WARNS"))
else if(equal(szKey, "NOSPREAD_WARNS"))
g_iSpreadSaveWarns = str_to_num(szValue);
g_iSpreadSaveWarns = str_to_num(szValue);
}
}
case OTHER:
case OTHER:
{
{
if(equal(szKey, "FLAG_ALERT"))
if(equal(szKey, "FLAG_ALERT"))
{
{
new szFlags[21];
new szFlags[21];
copy(szFlags, charsmax(szFlags), szValue);
copy(szFlags, charsmax(szFlags), szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
g_iAlertFlag = read_flags(szFlags);
g_iAlertFlag = read_flags(szFlags);
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "SEND_PROTECTION_WEAPON"))
else if(equal(szKey, "SEND_PROTECTION_WEAPON"))
g_iSendProtectionWeapon = str_to_num(szValue);
g_iSendProtectionWeapon = str_to_num(szValue);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
else if(equal(szKey, "CRASH_CHEAT"))
else if(equal(szKey, "CRASH_CHEAT"))
g_iCrashCheat = str_to_num(szValue);
g_iCrashCheat = str_to_num(szValue);
}
}
}
}
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
fclose(FileHandle);
fclose(FileHandle);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
SetCfg();
SetCfg();
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
return PLUGIN_CONTINUE;
return PLUGIN_CONTINUE;
}
}
stock SetCfg()
stock SetCfg()
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
ad_set_cfg(AimDetection, g_iAimDetection);
ad_set_cfg(AimDetection, g_iAimDetection);
ad_set_cfg(AimSens, g_iAimSens);
ad_set_cfg(AimSens, g_iAimSens);
ad_set_cfg(AimMultiWarns, g_iAimMultiWarn);
ad_set_cfg(AimMultiWarns, g_iAimMultiWarn);
ad_set_cfg(AimNotifyWarns, g_iAimNotify);
ad_set_cfg(AimNotifyWarns, g_iAimNotify);
ad_set_cfg(AimMaxWarns, g_iAimMaxWarns);
ad_set_cfg(AimMaxWarns, g_iAimMaxWarns);
ad_set_cfg(AimShotsReset, g_iAimShotsReset);
ad_set_cfg(AimShotsReset, g_iAimShotsReset);
ad_set_cfg(AimKillsReset, g_iAimKillsReset);
ad_set_cfg(AimKillsReset, g_iAimKillsReset);
ad_set_cfg(AimTimeReset, g_iAimTimeReset);
ad_set_cfg(AimTimeReset, g_iAimTimeReset);
ad_set_cfg(NoSpreadDetection, g_iSpreadDetection);
ad_set_cfg(NoSpreadDetection, g_iSpreadDetection);
ad_set_cfg(NoSpreadNotifyWarns, g_iSpreadNotify);
ad_set_cfg(NoSpreadNotifyWarns, g_iSpreadNotify);
ad_set_cfg(NoSpreadMaxWarns, g_iSpreadMaxWarns);
ad_set_cfg(NoSpreadMaxWarns, g_iSpreadMaxWarns);
ad_set_cfg(SendProtectionWeapon, g_iSendProtectionWeapon);
ad_set_cfg(SendProtectionWeapon, g_iSendProtectionWeapon);
ad_set_cfg(CrashCheat, g_iCrashCheat);
ad_set_cfg(CrashCheat, g_iCrashCheat);
}
}
stock PunishPlayer(id, PunishType:iType)
stock PunishPlayer(id, PunishType:iType)
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new szUserId[10], szSteam[33], szIp[17], szTime[10], szBanString[128];
new szUserId[10], szSteam[33], szIp[17], szTime[10], szBanString[128];
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(szUserId, charsmax(szUserId), "#%d", get_user_userid(id));
formatex(szUserId, charsmax(szUserId), "#%d", get_user_userid(id));
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_authid(id, szSteam, charsmax(szSteam));
get_user_ip(id, szIp, charsmax(szIp), 1);
get_user_ip(id, szIp, charsmax(szIp), 1);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
num_to_str(g_iBanTime[iType], szTime, charsmax(szTime));
num_to_str(g_iBanTime[iType], szTime, charsmax(szTime));
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
copy(szBanString, charsmax(szBanString), g_szBanString[iType]);
copy(szBanString, charsmax(szBanString), g_szBanString[iType]);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
replace_string(szBanString, charsmax(szBanString), "[userid]", szUserId);
replace_string(szBanString, charsmax(szBanString), "[userid]", szUserId);
replace_string(szBanString, charsmax(szBanString), "[steam]", szSteam);
replace_string(szBanString, charsmax(szBanString), "[steam]", szSteam);
replace_string(szBanString, charsmax(szBanString), "[ip]", szIp);
replace_string(szBanString, charsmax(szBanString), "[ip]", szIp);
replace_string(szBanString, charsmax(szBanString), "[reason]", g_szBanReason[iType]);
replace_string(szBanString, charsmax(szBanString), "[reason]", g_szBanReason[iType]);
replace_string(szBanString, charsmax(szBanString), "[time]", szTime);
replace_string(szBanString, charsmax(szBanString), "[time]", szTime);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
server_cmd("%s", szBanString);
server_cmd("%s", szBanString);
}
}
stock Send_Notify_Admins(const NotifyIndex, const Msg[])
stock Send_Notify_Admins(const NotifyIndex, const Msg[])
{
{
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
new Players[MAX_PLAYERS], iNum, iReceiver;
new Players[MAX_PLAYERS], iNum, iReceiver;
get_players(Players, iNum, "ch");
get_players(Players, iNum, "ch");
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
for (new i = 0; i < iNum; ++i)
for (new i = 0; i < iNum; ++i)
{
{
iReceiver = Players[i];
iReceiver = Players[i];
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
if(NotifyIndex == iReceiver || !(get_user_flags(iReceiver) & g_iAlertFlag)) {
if(NotifyIndex == iReceiver || !(get_user_flags(iReceiver) & g_iAlertFlag)) {
continue;
continue;
}
}
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
client_print_color(iReceiver, print_team_default, Msg);
client_print_color(iReceiver, print_team_default, Msg);
}
}
}
}
#if defined ENABLE_LOG_FILE
#if defined ENABLE_LOG_FILE
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
stock SaveLogFile(const LogText[])
stock SaveLogFile(const LogText[])
{
{
new LogFileTime[32], LogTime[32], LogFile[128], LogMsg[190];
new LogFileTime[32], LogTime[32], LogFile[128], LogMsg[190];
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
get_time("20%y.%m.%d", LogFileTime, charsmax(LogFileTime));
get_time("20%y.%m.%d", LogFileTime, charsmax(LogFileTime));
get_time("%H:%M:%S", LogTime, charsmax(LogTime));
get_time("%H:%M:%S", LogTime, charsmax(LogTime));
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
formatex(LogFile, charsmax(LogFile), "%s/%s.log", g_LogDir, LogFileTime);
formatex(LogFile, charsmax(LogFile), "%s/%s.log", g_LogDir, LogFileTime);
formatex(LogMsg, charsmax(LogMsg), "[%s] [%s] %s", LogFileTime, LogTime, LogText);
formatex(LogMsg, charsmax(LogMsg), "[%s] [%s] %s", LogFileTime, LogTime, LogText);
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
write_file(LogFile, LogMsg, -1);
write_file(LogFile, LogMsg, -1);
}
}
#endif
#endif
#if (AMXX_VERSION_NUM < 183)
#if (AMXX_VERSION_NUM < 183)
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
stock client_print_color(const id, const iSender, const input[], any:...)
stock client_print_color(const id, const iSender, const input[], any:...)
{
{
static iSayText = 0;
static iSayText = 0;
if (!iSayText) {
if (!iSayText) {
iSayText = get_user_msgid("SayText");
iSayText = get_user_msgid("SayText");
}
}
new iReceiver, iNum = 1, Players[MAX_PLAYERS], Msg[190];
new iReceiver, iNum = 1, Players[MAX_PLAYERS], Msg[190];
vformat(Msg, charsmax(Msg), input, 3);
vformat(Msg, charsmax(Msg), input, 3);
if(id)
if(id)
{
{
if(!is_user_connected(id)) {
if(!is_user_connected(id)) {
return;
return;
}
}
Players[0] = id;
Players[0] = id;
} else {
} else {
get_players(Players, iNum, "ch");
get_players(Players, iNum, "ch");
}
}
for (new i = 0; i < iNum; i++)
for (new i = 0; i < iNum; i++)
{
{
iReceiver = Players[i];
iReceiver = Players[i];
message_begin(MSG_ONE, iSayText , _, iReceiver);
message_begin(MSG_ONE, iSayText , _, iReceiver);
write_byte(iSender ? iSender : iReceiver);
write_byte(iSender ? iSender : iReceiver);
write_string(Msg);
write_string(Msg);
message_end();
message_end();
}
}
}
}
#endif
#endif
सेव किए गए Diffs
ऑरिजनल टेक्स्ट
फ़ाइल खोलें
#include <amxmodx> #include <reaimdetector> #pragma semicolon 1 #if !defined MAX_PLAYERS #define MAX_PLAYERS 32 #endif #if defined client_disconnected #define player_disconnect client_disconnected #else #define player_disconnect client_disconnect #endif #define ENABLE_LOG_FILE // Включить логирование #define RELOAD_CMD ADMIN_CFG // Флаг доступа к команде перезагрузки конфига: reaim_reloadcfg #define MENU_CMD ADMIN_BAN // Флаг доступа к Aim меню: say /aim enum CfgType { AIM = 1, SPREAD, PUNISH, SAVE, OTHER } #if (AMXX_VERSION_NUM < 183) enum { print_team_default = 0, print_team_grey = -1, print_team_red = -2, print_team_blue = -3 }; #define replace_string replace_all #endif new Trie:g_tAimBotSteamWarns, Trie:g_tAimBotIpWarns; new Trie:g_tNoSpreadSteamWarns, Trie:g_tNoSpreadIpWarns; new g_iAimDetection, g_iAimSens, g_iAimMultiWarn, g_iAimNotify, g_iAimMaxWarns, g_iAimShotsReset, g_iAimKillsReset, g_iAimTimeReset; new g_iSaveType, g_iAimSaveWarns, g_iSpreadSaveWarns; new g_iSpreadDetection, g_iSpreadNotify, g_iSpreadMaxWarns; new g_iAlertFlag; new g_iSendProtectionWeapon; new g_iCrashCheat; new g_iBanTime[PunishType]; new g_szBanReason[PunishType][64]; new g_szBanString[PunishType][128]; #if defined ENABLE_LOG_FILE new g_FilePath[64], g_LogDir[128]; #endif public plugin_init() { register_plugin("ReAimDetector API", REAIMDETECTOR_VERSION, "ReHLDS Team"); register_concmd("reaim_reloadcfg", "ReloadCfg", RELOAD_CMD); register_clcmd("say /aim", "AimMenu", MENU_CMD); register_clcmd("say_team /aim", "AimMenu", MENU_CMD); g_tAimBotSteamWarns = TrieCreate(); g_tAimBotIpWarns = TrieCreate(); g_tNoSpreadSteamWarns = TrieCreate(); g_tNoSpreadIpWarns = TrieCreate(); } public plugin_end() { #if defined ENABLE_LOG_FILE new Map[32], BufLog[64]; get_mapname(Map, charsmax(Map)); formatex(BufLog, charsmax(BufLog), "End Map [%s]", Map); SaveLogFile(BufLog); #endif TrieClear(g_tAimBotSteamWarns); TrieClear(g_tAimBotIpWarns); TrieClear(g_tNoSpreadSteamWarns); TrieClear(g_tNoSpreadIpWarns); } public client_putinserver(id) { switch(g_iSaveType) { case 1: { new szSteam[33], iWarns; get_user_authid(id, szSteam, charsmax(szSteam)); #if defined ENABLE_LOG_FILE new szBufLog[190], szAddress[17], szName[32]; get_user_ip(id, szAddress, charsmax(szAddress), 1); get_user_name(id, szName, charsmax(szName)); #endif if(TrieKeyExists(g_tAimBotSteamWarns, szSteam)) { TrieGetCell(g_tAimBotSteamWarns, szSteam, iWarns); TrieDeleteKey(g_tAimBotSteamWarns, szSteam); ad_set_client(id, AimWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } if(TrieKeyExists(g_tNoSpreadSteamWarns, szSteam)) { TrieGetCell(g_tNoSpreadSteamWarns, szSteam, iWarns); TrieDeleteKey(g_tNoSpreadSteamWarns, szSteam); ad_set_client(id, NoSpreadWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } } case 2: { new szAddress[17], iWarns; get_user_ip(id, szAddress, charsmax(szAddress), 1); #if defined ENABLE_LOG_FILE new szBufLog[190], szSteam[33], szName[32]; get_user_authid(id, szSteam, charsmax(szSteam)); get_user_name(id, szName, charsmax(szName)); #endif if(TrieKeyExists(g_tAimBotIpWarns, szAddress)) { TrieGetCell(g_tAimBotIpWarns, szAddress, iWarns); TrieDeleteKey(g_tAimBotIpWarns, szAddress); ad_set_client(id, AimWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } if(TrieKeyExists(g_tNoSpreadIpWarns, szAddress)) { TrieGetCell(g_tNoSpreadIpWarns, szAddress, iWarns); TrieDeleteKey(g_tNoSpreadIpWarns, szAddress); ad_set_client(id, NoSpreadWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } } case 3: { new szSteam[33], szAddress[17], iWarns; get_user_authid(id, szSteam, charsmax(szSteam)); get_user_ip(id, szAddress, charsmax(szAddress), 1); #if defined ENABLE_LOG_FILE new szBufLog[190], szName[32]; get_user_name(id, szName, charsmax(szName)); #endif new bool:IsExistsAim = false; new bool:IsExistsSpread = false; if(TrieKeyExists(g_tAimBotSteamWarns, szSteam)) { IsExistsAim = true; TrieGetCell(g_tAimBotSteamWarns, szSteam, iWarns); TrieDeleteKey(g_tAimBotSteamWarns, szSteam); ad_set_client(id, AimWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } if(TrieKeyExists(g_tAimBotIpWarns, szAddress)) { if(IsExistsAim) { TrieDeleteKey(g_tAimBotIpWarns, szAddress); } else { TrieGetCell(g_tAimBotIpWarns, szAddress, iWarns); TrieDeleteKey(g_tAimBotIpWarns, szAddress); ad_set_client(id, AimWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } } if(TrieKeyExists(g_tNoSpreadSteamWarns, szSteam)) { IsExistsSpread = true; TrieGetCell(g_tNoSpreadSteamWarns, szSteam, iWarns); TrieDeleteKey(g_tNoSpreadSteamWarns, szSteam); ad_set_client(id, NoSpreadWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } if(TrieKeyExists(g_tNoSpreadIpWarns, szAddress)) { if(IsExistsSpread) { TrieDeleteKey(g_tNoSpreadIpWarns, szAddress); } else { TrieGetCell(g_tNoSpreadIpWarns, szAddress, iWarns); TrieDeleteKey(g_tNoSpreadIpWarns, szAddress); ad_set_client(id, NoSpreadWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } } } } } public player_disconnect(id) { switch(g_iSaveType) { case 1: { new szSteam[33]; get_user_authid(id, szSteam, charsmax(szSteam)); new iAimBotWarns = ad_get_client(id, AimWarn); new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn); if(iAimBotWarns >= g_iAimSaveWarns) { TrieSetCell(g_tAimBotSteamWarns, szSteam, iAimBotWarns); } if(iNoSpreadWarns >= g_iSpreadSaveWarns) { TrieSetCell(g_tNoSpreadSteamWarns, szSteam, iNoSpreadWarns); } } case 2: { new szAddress[17]; get_user_ip(id, szAddress, charsmax(szAddress), 1); new iAimBotWarns = ad_get_client(id, AimWarn); new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn); if(iAimBotWarns >= g_iAimSaveWarns) { TrieSetCell(g_tAimBotIpWarns, szAddress, iAimBotWarns); } if(iNoSpreadWarns >= g_iSpreadSaveWarns) { TrieSetCell(g_tNoSpreadIpWarns, szAddress, iNoSpreadWarns); } } case 3: { new szSteam[33], szAddress[17]; get_user_authid(id, szSteam, charsmax(szSteam)); get_user_ip(id, szAddress, charsmax(szAddress), 1); new iAimBotWarns = ad_get_client(id, AimWarn); new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn); if(iAimBotWarns >= g_iAimSaveWarns) { TrieSetCell(g_tAimBotSteamWarns, szSteam, iAimBotWarns); TrieSetCell(g_tAimBotIpWarns, szAddress, iAimBotWarns); } if(iNoSpreadWarns >= g_iSpreadSaveWarns) { TrieSetCell(g_tNoSpreadSteamWarns, szSteam, iNoSpreadWarns); TrieSetCell(g_tNoSpreadIpWarns, szAddress, iNoSpreadWarns); } } } } public ReloadCfg(id, level, cid) { if(~get_user_flags(id) & level) { return PLUGIN_CONTINUE; } ReadCfg(); client_print(id, print_console, "[Aim Detector]: Reload Cfg."); return PLUGIN_HANDLED; } public AimMenu(id, level) { if(~get_user_flags(id) & level) { return PLUGIN_CONTINUE; } static iPlayers[32], iNum, i, iPlayer; get_players(iPlayers, iNum, "ch"); new szName[32], szInfo[3], szTempString[96]; new iMenu = menu_create("\wAim Detector Меню", "AimMenuHandler"); new bool:bFindPlayer = false; for(i = 0; i < iNum; i++) { iPlayer = iPlayers[i]; new iAimBotWarns = ad_get_client(iPlayer, AimWarn); new iNoSpreadWarns = ad_get_client(iPlayer, NoSpreadWarn); if(iAimBotWarns == 0 && iNoSpreadWarns == 0) { continue; } bFindPlayer = true; get_user_name(iPlayer, szName, charsmax(szName)); formatex(szTempString, charsmax(szTempString), "\w%s \r[\yAim\r: \w%d\r|\yNoSpread\r: \w%d\r]", szName, iAimBotWarns, iNoSpreadWarns); num_to_str(iPlayer, szInfo, charsmax(szInfo)); menu_additem(iMenu, szTempString, szInfo); } if(bFindPlayer) { menu_setprop(iMenu, MPROP_NUMBER_COLOR, "\r"); menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL); menu_setprop(iMenu, MPROP_EXITNAME, "Выход"); menu_setprop(iMenu, MPROP_NEXTNAME, "Далее"); menu_setprop(iMenu, MPROP_BACKNAME, "Назад"); menu_display(id, iMenu); } else { new szBufNotify[190]; formatex(szBufNotify, charsmax(szBufNotify), "^1[^4Aim Detector^1] ^3Список ^1в ^4меню ^3пустой^1."); client_print_color(id, print_team_default, szBufNotify); } return PLUGIN_HANDLED; } public AimMenuHandler(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } new iAccess, szInfo[3], iCallback; menu_item_getinfo(menu, item, iAccess, szInfo, charsmax(szInfo), .callback = iCallback); new iPlayer = str_to_num(szInfo); new iAimWarn = ad_get_client(iPlayer, AimWarn); new iSpreadWarn = ad_get_client(iPlayer, NoSpreadWarn); new szBufNotify[190], szName[32]; get_user_name(iPlayer, szName, charsmax(szName)); formatex(szBufNotify, charsmax(szBufNotify), "^1[^4Aim Detector^1] ^3Name ^1[^4 %s ^1] ^3AimWarn ^1[^4 %d ^1] ^3NoSpreadWarn ^1[^4 %d ^1]", szName, iAimWarn, iSpreadWarn); client_print_color(id, print_team_default, szBufNotify); return PLUGIN_HANDLED; } public ad_init(const Version[], const Map[]) { #if defined ENABLE_LOG_FILE get_localinfo("amxx_logs", g_FilePath, charsmax(g_FilePath)); formatex(g_LogDir, charsmax(g_LogDir), "%s/reaimdetector", g_FilePath); if(!dir_exists(g_LogDir)) { mkdir(g_LogDir); } #endif ReadCfg(); #if defined ENABLE_LOG_FILE new szBufLog[190]; formatex(szBufLog, charsmax(szBufLog), "Start Map [%s] AimSens [%d] AimMaxWarns [%d] NoSpreadNotifyWarns [%d] NoSpreadMaxWarns [%d]", Map, ad_get_cfg(AimSens), g_iAimMaxWarns, ad_get_cfg(NoSpreadNotifyWarns), g_iSpreadMaxWarns); SaveLogFile(szBufLog); #endif } public ad_notify(const index, const PunishType:pType, const NotifyType:nType, const Kills, const Shots, const Warn) { new szBufNotify[190], szName[32]; #if defined ENABLE_LOG_FILE new szBufLog[190], szAddress[22], szSteam[33]; get_user_ip(index, szAddress, charsmax(szAddress)); get_user_authid(index, szSteam, charsmax(szSteam)); #endif get_user_name(index, szName, charsmax(szName)); if(pType == AIMBOT) { if(nType == WARNING && Warn > g_iAimNotify) { formatex(szBufNotify, charsmax(szBufNotify), "^1[^4Aim Detector^1] ^3Name ^1[^4 %s ^1] ^3Warn ^1[^4 %d ^1] ^3MaxWarn ^1[^4 %d ^1]", szName, Warn, g_iAimMaxWarns); Send_Notify_Admins(index, szBufNotify); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Add: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn); SaveLogFile(szBufLog); #endif } else if(nType == DETECT) { formatex(szBufNotify, charsmax(szBufNotify), "^1[^4Aim Detector^1] ^3Name ^1[^4 %s ^1] ^3Detected", szName); Send_Notify_Admins(index, szBufNotify); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Detected: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn); SaveLogFile(szBufLog); #endif ad_set_client(index, AimCheck, 0); PunishPlayer(index, AIMBOT); } } else if(pType == NOSPREAD) { if(nType == WARNING && Warn > g_iSpreadNotify) { formatex(szBufNotify, charsmax(szBufNotify), "^1[^4NoSpread Detector^1] ^3Name ^1[^4 %s ^1] ^3Warn ^1[^4 %d ^1]", szName, Warn, g_iSpreadMaxWarns); Send_Notify_Admins(index, szBufNotify); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Add: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn); SaveLogFile(szBufLog); #endif } else if(nType == DETECT) { formatex(szBufNotify, charsmax(szBufNotify), "^1[^4NoSpread Detector^1] ^3Name ^1[^4 %s ^1] ^3Detected", szName); Send_Notify_Admins(index, szBufNotify); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Detected: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn); SaveLogFile(szBufLog); #endif ad_set_client(index, NoSpreadCheck, 0); PunishPlayer(index, NOSPREAD); } } } #if defined ENABLE_LOG_FILE public ad_aim_reset_warn(const index, const ResetType:rType, const Kills, const Shots) { new szBufLog[190], szName[32], szAddress[22], szSteam[33]; get_user_name(index, szName, charsmax(szName)); get_user_ip(index, szAddress, charsmax(szAddress)); get_user_authid(index, szSteam, charsmax(szSteam)); switch(rType) { case KILLED: { formatex(szBufLog, charsmax(szBufLog), "Killed Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills + 1, Shots); SaveLogFile(szBufLog); } case SHOTS: { formatex(szBufLog, charsmax(szBufLog), "Shots Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills, Shots + 1); SaveLogFile(szBufLog); } case TIME: { formatex(szBufLog, charsmax(szBufLog), "Time Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills, Shots); SaveLogFile(szBufLog); } } } #endif stock ReadCfg() { new szFilePath[64]; get_localinfo("amxx_configsdir", szFilePath, charsmax(szFilePath)); formatex(szFilePath, charsmax(szFilePath), "%s/reaimdetector.ini", szFilePath); new FileHandle = fopen(szFilePath, "rt"); if(!FileHandle) { set_fail_state("Error load cfg."); } new szTemp[256], szKey[32], szValue[512], iSection; while(!feof(FileHandle)) { fgets(FileHandle, szTemp, charsmax(szTemp)); trim(szTemp); if (szTemp[0] == '[') { iSection++; continue; } if(!szTemp[0] || szTemp[0] == ';' || szTemp[0] == '/') { continue; } strtok(szTemp, szKey, charsmax(szKey), szValue, charsmax(szValue), '='); trim(szKey); trim(szValue); switch(iSection) { case AIM: { if(equal(szKey, "AIM_DETECTION")) g_iAimDetection = str_to_num(szValue); else if(equal(szKey, "SENS")) g_iAimSens = str_to_num(szValue); else if(equal(szKey, "MULTI_WARN")) g_iAimMultiWarn = str_to_num(szValue); else if(equal(szKey, "NOTIFY_WARNS")) g_iAimNotify = str_to_num(szValue); else if(equal(szKey, "MAX_WARNS")) g_iAimMaxWarns = str_to_num(szValue); else if(equal(szKey, "SHOTS_RESET")) g_iAimShotsReset = str_to_num(szValue); else if(equal(szKey, "KILLS_RESET")) g_iAimKillsReset = str_to_num(szValue); else if(equal(szKey, "TIME_RESET")) g_iAimTimeReset = str_to_num(szValue); } case SPREAD: { if(equal(szKey, "NOSPREAD_DETECTION")) g_iSpreadDetection = str_to_num(szValue); else if(equal(szKey, "NOTIFY_WARNS")) g_iSpreadNotify = str_to_num(szValue); else if(equal(szKey, "MAX_WARNS")) g_iSpreadMaxWarns = str_to_num(szValue); } case PUNISH: { if(equal(szKey, "REASON_AIMBOT")) copy(g_szBanReason[AIMBOT], charsmax(g_szBanReason[]), szValue); else if(equal(szKey, "BAN_TIME_AIMBOT")) g_iBanTime[AIMBOT] = str_to_num(szValue); else if(equal(szKey, "REASON_NOSPREAD")) copy(g_szBanReason[NOSPREAD], charsmax(g_szBanReason[]), szValue); else if(equal(szKey, "BAN_TIME_NOSPREAD")) g_iBanTime[NOSPREAD] = str_to_num(szValue); else if(equal(szKey, "PUNISH_AIMBOT")) copy(g_szBanString[AIMBOT], charsmax(g_szBanString[]), szValue); else if(equal(szKey, "PUNISH_NOSPREAD")) copy(g_szBanString[NOSPREAD], charsmax(g_szBanString[]), szValue); } case SAVE: { if(equal(szKey, "TYPE")) g_iSaveType = str_to_num(szValue); else if(equal(szKey, "AIM_WARNS")) g_iAimSaveWarns = str_to_num(szValue); else if(equal(szKey, "NOSPREAD_WARNS")) g_iSpreadSaveWarns = str_to_num(szValue); } case OTHER: { if(equal(szKey, "FLAG_ALERT")) { new szFlags[21]; copy(szFlags, charsmax(szFlags), szValue); g_iAlertFlag = read_flags(szFlags); } else if(equal(szKey, "SEND_PROTECTION_WEAPON")) g_iSendProtectionWeapon = str_to_num(szValue); else if(equal(szKey, "CRASH_CHEAT")) g_iCrashCheat = str_to_num(szValue); } } } fclose(FileHandle); SetCfg(); return PLUGIN_CONTINUE; } stock SetCfg() { ad_set_cfg(AimDetection, g_iAimDetection); ad_set_cfg(AimSens, g_iAimSens); ad_set_cfg(AimMultiWarns, g_iAimMultiWarn); ad_set_cfg(AimNotifyWarns, g_iAimNotify); ad_set_cfg(AimMaxWarns, g_iAimMaxWarns); ad_set_cfg(AimShotsReset, g_iAimShotsReset); ad_set_cfg(AimKillsReset, g_iAimKillsReset); ad_set_cfg(AimTimeReset, g_iAimTimeReset); ad_set_cfg(NoSpreadDetection, g_iSpreadDetection); ad_set_cfg(NoSpreadNotifyWarns, g_iSpreadNotify); ad_set_cfg(NoSpreadMaxWarns, g_iSpreadMaxWarns); ad_set_cfg(SendProtectionWeapon, g_iSendProtectionWeapon); ad_set_cfg(CrashCheat, g_iCrashCheat); } stock PunishPlayer(id, PunishType:iType) { new szUserId[10], szSteam[33], szIp[17], szTime[10], szBanString[128]; formatex(szUserId, charsmax(szUserId), "#%d", get_user_userid(id)); get_user_authid(id, szSteam, charsmax(szSteam)); get_user_ip(id, szIp, charsmax(szIp), 1); num_to_str(g_iBanTime[iType], szTime, charsmax(szTime)); copy(szBanString, charsmax(szBanString), g_szBanString[iType]); replace_string(szBanString, charsmax(szBanString), "[userid]", szUserId); replace_string(szBanString, charsmax(szBanString), "[steam]", szSteam); replace_string(szBanString, charsmax(szBanString), "[ip]", szIp); replace_string(szBanString, charsmax(szBanString), "[reason]", g_szBanReason[iType]); replace_string(szBanString, charsmax(szBanString), "[time]", szTime); server_cmd("%s", szBanString); } stock Send_Notify_Admins(const NotifyIndex, const Msg[]) { new Players[MAX_PLAYERS], iNum, iReceiver; get_players(Players, iNum, "ch"); for (new i = 0; i < iNum; ++i) { iReceiver = Players[i]; if(NotifyIndex == iReceiver || !(get_user_flags(iReceiver) & g_iAlertFlag)) { continue; } client_print_color(iReceiver, print_team_default, Msg); } } #if defined ENABLE_LOG_FILE stock SaveLogFile(const LogText[]) { new LogFileTime[32], LogTime[32], LogFile[128], LogMsg[190]; get_time("20%y.%m.%d", LogFileTime, charsmax(LogFileTime)); get_time("%H:%M:%S", LogTime, charsmax(LogTime)); formatex(LogFile, charsmax(LogFile), "%s/%s.log", g_LogDir, LogFileTime); formatex(LogMsg, charsmax(LogMsg), "[%s] [%s] %s", LogFileTime, LogTime, LogText); write_file(LogFile, LogMsg, -1); } #endif #if (AMXX_VERSION_NUM < 183) stock client_print_color(const id, const iSender, const input[], any:...) { static iSayText = 0; if (!iSayText) { iSayText = get_user_msgid("SayText"); } new iReceiver, iNum = 1, Players[MAX_PLAYERS], Msg[190]; vformat(Msg, charsmax(Msg), input, 3); if(id) { if(!is_user_connected(id)) { return; } Players[0] = id; } else { get_players(Players, iNum, "ch"); } for (new i = 0; i < iNum; i++) { iReceiver = Players[i]; message_begin(MSG_ONE, iSayText , _, iReceiver); write_byte(iSender ? iSender : iReceiver); write_string(Msg); message_end(); } } #endif
परिवर्तित टेक्स्ट
फ़ाइल खोलें
#include <amxmodx> #include <reaimdetector> #pragma semicolon 1 #if !defined MAX_PLAYERS #define MAX_PLAYERS 32 #endif #if defined client_disconnected #define player_disconnect client_disconnected #else #define player_disconnect client_disconnect #endif #define ENABLE_LOG_FILE // Включить логирование #define RELOAD_CMD ADMIN_IMMUNITY // Флаг доступа к команде перезагрузки конфига: reaim_reloadcfg #define MENU_CMD ADMIN_IMMUNITY // Флаг доступа к Aim меню: say /aim new const reAIMPrefix[] = "^4[ReAim]^1"; new const NSDPrefix[] = "^4[NSD]^1"; enum CfgType { AIM = 1, SPREAD, PUNISH, SAVE, OTHER } #if (AMXX_VERSION_NUM < 183) enum { print_team_default = 0, print_team_grey = -1, print_team_red = -2, print_team_blue = -3 }; #define replace_string replace_all #endif new Trie:g_tAimBotSteamWarns, Trie:g_tAimBotIpWarns; new Trie:g_tNoSpreadSteamWarns, Trie:g_tNoSpreadIpWarns; new g_iAimDetection, g_iAimSens, g_iAimMultiWarn, g_iAimNotify, g_iAimMaxWarns, g_iAimShotsReset, g_iAimKillsReset, g_iAimTimeReset; new g_iSaveType, g_iAimSaveWarns, g_iSpreadSaveWarns; new g_iSpreadDetection, g_iSpreadNotify, g_iSpreadMaxWarns; new g_iAlertFlag; new g_iSendProtectionWeapon; new g_iCrashCheat; new g_iBanTime[PunishType]; new g_szBanReason[PunishType][64]; new g_szBanString[PunishType][128]; #if defined ENABLE_LOG_FILE new g_FilePath[64], g_LogDir[128]; #endif static const configs_file[] = "addons_configs/amxx4u/antycheat/reaimdetector.ini"; public plugin_init() { register_plugin("ReAimDetector API", REAIMDETECTOR_VERSION, "ReHLDS Team & NewITVision", "https://amxx4u.pl/"); register_concmd("reaim_reloadcfg", "ReloadCfg", ADMIN_IMMUNITY); register_clcmd("say /aim", "AimMenu", MENU_CMD); register_clcmd("say_team /aim", "AimMenu", MENU_CMD); g_tAimBotSteamWarns = TrieCreate(); g_tAimBotIpWarns = TrieCreate(); g_tNoSpreadSteamWarns = TrieCreate(); g_tNoSpreadIpWarns = TrieCreate(); } public plugin_end() { #if defined ENABLE_LOG_FILE new Map[32], BufLog[64]; get_mapname(Map, charsmax(Map)); formatex(BufLog, charsmax(BufLog), "End Map [%s]", Map); SaveLogFile(BufLog); #endif TrieClear(g_tAimBotSteamWarns); TrieClear(g_tAimBotIpWarns); TrieClear(g_tNoSpreadSteamWarns); TrieClear(g_tNoSpreadIpWarns); } public client_putinserver(id) { switch(g_iSaveType) { case 1: { new szSteam[33], iWarns; get_user_authid(id, szSteam, charsmax(szSteam)); #if defined ENABLE_LOG_FILE new szBufLog[190], szAddress[17], szName[32]; get_user_ip(id, szAddress, charsmax(szAddress), 1); get_user_name(id, szName, charsmax(szName)); #endif if(TrieKeyExists(g_tAimBotSteamWarns, szSteam)) { TrieGetCell(g_tAimBotSteamWarns, szSteam, iWarns); TrieDeleteKey(g_tAimBotSteamWarns, szSteam); ad_set_client(id, AimWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } if(TrieKeyExists(g_tNoSpreadSteamWarns, szSteam)) { TrieGetCell(g_tNoSpreadSteamWarns, szSteam, iWarns); TrieDeleteKey(g_tNoSpreadSteamWarns, szSteam); ad_set_client(id, NoSpreadWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } } case 2: { new szAddress[17], iWarns; get_user_ip(id, szAddress, charsmax(szAddress), 1); #if defined ENABLE_LOG_FILE new szBufLog[190], szSteam[33], szName[32]; get_user_authid(id, szSteam, charsmax(szSteam)); get_user_name(id, szName, charsmax(szName)); #endif if(TrieKeyExists(g_tAimBotIpWarns, szAddress)) { TrieGetCell(g_tAimBotIpWarns, szAddress, iWarns); TrieDeleteKey(g_tAimBotIpWarns, szAddress); ad_set_client(id, AimWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } if(TrieKeyExists(g_tNoSpreadIpWarns, szAddress)) { TrieGetCell(g_tNoSpreadIpWarns, szAddress, iWarns); TrieDeleteKey(g_tNoSpreadIpWarns, szAddress); ad_set_client(id, NoSpreadWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } } case 3: { new szSteam[33], szAddress[17], iWarns; get_user_authid(id, szSteam, charsmax(szSteam)); get_user_ip(id, szAddress, charsmax(szAddress), 1); #if defined ENABLE_LOG_FILE new szBufLog[190], szName[32]; get_user_name(id, szName, charsmax(szName)); #endif new bool:IsExistsAim = false; new bool:IsExistsSpread = false; if(TrieKeyExists(g_tAimBotSteamWarns, szSteam)) { IsExistsAim = true; TrieGetCell(g_tAimBotSteamWarns, szSteam, iWarns); TrieDeleteKey(g_tAimBotSteamWarns, szSteam); ad_set_client(id, AimWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } if(TrieKeyExists(g_tAimBotIpWarns, szAddress)) { if(IsExistsAim) { TrieDeleteKey(g_tAimBotIpWarns, szAddress); } else { TrieGetCell(g_tAimBotIpWarns, szAddress, iWarns); TrieDeleteKey(g_tAimBotIpWarns, szAddress); ad_set_client(id, AimWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } } if(TrieKeyExists(g_tNoSpreadSteamWarns, szSteam)) { IsExistsSpread = true; TrieGetCell(g_tNoSpreadSteamWarns, szSteam, iWarns); TrieDeleteKey(g_tNoSpreadSteamWarns, szSteam); ad_set_client(id, NoSpreadWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (Steam): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } if(TrieKeyExists(g_tNoSpreadIpWarns, szAddress)) { if(IsExistsSpread) { TrieDeleteKey(g_tNoSpreadIpWarns, szAddress); } else { TrieGetCell(g_tNoSpreadIpWarns, szAddress, iWarns); TrieDeleteKey(g_tNoSpreadIpWarns, szAddress); ad_set_client(id, NoSpreadWarn, iWarns); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Recovered (IP): ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", id, szName, szSteam, szAddress, iWarns); SaveLogFile(szBufLog); #endif } } } } } public player_disconnect(id) { switch(g_iSaveType) { case 1: { new szSteam[33]; get_user_authid(id, szSteam, charsmax(szSteam)); new iAimBotWarns = ad_get_client(id, AimWarn); new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn); if(iAimBotWarns >= g_iAimSaveWarns) { TrieSetCell(g_tAimBotSteamWarns, szSteam, iAimBotWarns); } if(iNoSpreadWarns >= g_iSpreadSaveWarns) { TrieSetCell(g_tNoSpreadSteamWarns, szSteam, iNoSpreadWarns); } } case 2: { new szAddress[17]; get_user_ip(id, szAddress, charsmax(szAddress), 1); new iAimBotWarns = ad_get_client(id, AimWarn); new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn); if(iAimBotWarns >= g_iAimSaveWarns) { TrieSetCell(g_tAimBotIpWarns, szAddress, iAimBotWarns); } if(iNoSpreadWarns >= g_iSpreadSaveWarns) { TrieSetCell(g_tNoSpreadIpWarns, szAddress, iNoSpreadWarns); } } case 3: { new szSteam[33], szAddress[17]; get_user_authid(id, szSteam, charsmax(szSteam)); get_user_ip(id, szAddress, charsmax(szAddress), 1); new iAimBotWarns = ad_get_client(id, AimWarn); new iNoSpreadWarns = ad_get_client(id, NoSpreadWarn); if(iAimBotWarns >= g_iAimSaveWarns) { TrieSetCell(g_tAimBotSteamWarns, szSteam, iAimBotWarns); TrieSetCell(g_tAimBotIpWarns, szAddress, iAimBotWarns); } if(iNoSpreadWarns >= g_iSpreadSaveWarns) { TrieSetCell(g_tNoSpreadSteamWarns, szSteam, iNoSpreadWarns); TrieSetCell(g_tNoSpreadIpWarns, szAddress, iNoSpreadWarns); } } } } public ReloadCfg(id, level, cid) { if(~get_user_flags(id) & level) { return PLUGIN_CONTINUE; } ReadCfg(); client_print(id, print_console, "[Aim Detector]: Reload Cfg."); return PLUGIN_HANDLED; } public AimMenu(id, level) { if(~get_user_flags(id) & level) { return PLUGIN_CONTINUE; } static iPlayers[32], iNum, i, iPlayer; get_players(iPlayers, iNum, "ch"); new szName[32], szInfo[3], szTempString[96]; new iMenu = menu_create("\wAim Detector menu", "AimMenuHandler"); new bool:bFindPlayer = false; for(i = 0; i < iNum; i++) { iPlayer = iPlayers[i]; new iAimBotWarns = ad_get_client(iPlayer, AimWarn); new iNoSpreadWarns = ad_get_client(iPlayer, NoSpreadWarn); if(iAimBotWarns == 0 && iNoSpreadWarns == 0) { continue; } bFindPlayer = true; get_user_name(iPlayer, szName, charsmax(szName)); formatex(szTempString, charsmax(szTempString), "\w%s \r[\yAim\r: \w%d\r|\yNoSpread\r: \w%d\r]", szName, iAimBotWarns, iNoSpreadWarns); num_to_str(iPlayer, szInfo, charsmax(szInfo)); menu_additem(iMenu, szTempString, szInfo); } if(bFindPlayer) { menu_setprop(iMenu, MPROP_NUMBER_COLOR, "\r"); menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL); menu_setprop(iMenu, MPROP_EXITNAME, "Выход"); menu_setprop(iMenu, MPROP_NEXTNAME, "Далее"); menu_setprop(iMenu, MPROP_BACKNAME, "Назад"); menu_display(id, iMenu); } else { new szBufNotify[190]; formatex(szBufNotify, charsmax(szBufNotify), "%s Lista w menu jest^4 pusta^1.", reAIMPrefix); client_print_color(id, print_team_default, szBufNotify); } return PLUGIN_HANDLED; } public AimMenuHandler(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } new iAccess, szInfo[3], iCallback; menu_item_getinfo(menu, item, iAccess, szInfo, charsmax(szInfo), .callback = iCallback); new iPlayer = str_to_num(szInfo); new iAimWarn = ad_get_client(iPlayer, AimWarn); new iSpreadWarn = ad_get_client(iPlayer, NoSpreadWarn); new szBufNotify[190], szName[32]; get_user_name(iPlayer, szName, charsmax(szName)); formatex(szBufNotify, charsmax(szBufNotify), "%s Name ^4[%s]^1 AimWarn ^4[%d]^1 NoSpreadWarn ^4[%d]^1", reAIMPrefix, szName, iAimWarn, iSpreadWarn); client_print_color(id, print_team_default, szBufNotify); return PLUGIN_HANDLED; } public ad_init(const Version[], const Map[]) { #if defined ENABLE_LOG_FILE get_localinfo("amxx_logs", g_FilePath, charsmax(g_FilePath)); formatex(g_LogDir, charsmax(g_LogDir), "%s", g_FilePath); if(!dir_exists(g_LogDir)) { mkdir(g_LogDir); } #endif ReadCfg(); #if defined ENABLE_LOG_FILE new szBufLog[190]; formatex(szBufLog, charsmax(szBufLog), "Start Map [%s] AimSens [%d] AimMaxWarns [%d] NoSpreadNotifyWarns [%d] NoSpreadMaxWarns [%d]", Map, ad_get_cfg(AimSens), g_iAimMaxWarns, ad_get_cfg(NoSpreadNotifyWarns), g_iSpreadMaxWarns); SaveLogFile(szBufLog); #endif } public ad_notify(const index, const PunishType:pType, const NotifyType:nType, const Kills, const Shots, const Warn) { new szBufNotify[190], szName[32]; #if defined ENABLE_LOG_FILE new szBufLog[190], szAddress[22], szSteam[33]; get_user_ip(index, szAddress, charsmax(szAddress)); get_user_authid(index, szSteam, charsmax(szSteam)); #endif get_user_name(index, szName, charsmax(szName)); if(pType == AIMBOT) { if(nType == WARNING && Warn > g_iAimNotify) { formatex(szBufNotify, charsmax(szBufNotify), "%s Nick:^4 %s^1 | Ostrzerzenie:^4 %d^1 | Max ostrzezen:^4 %d^1", reAIMPrefix, szName, Warn, g_iAimMaxWarns); Send_Notify_Admins(index, szBufNotify); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Warn Add: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn); SaveLogFile(szBufLog); #endif } else if(nType == DETECT) { formatex(szBufNotify, charsmax(szBufNotify), "%s Nick:^4 %s^3 Detected", reAIMPrefix, szName); Send_Notify_Admins(index, szBufNotify); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "Aim Detected: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn); SaveLogFile(szBufLog); #endif ad_set_client(index, AimCheck, 0); PunishPlayer(index, AIMBOT); } } else if(pType == NOSPREAD) { if(nType == WARNING && Warn > g_iSpreadNotify) { formatex(szBufNotify, charsmax(szBufNotify), "%s Nick^4 %s^1 | Ostrzezenie^4 %d^1 | Max ostrzezen^4 %d^1", NSDPrefix, szName, Warn, g_iSpreadMaxWarns); Send_Notify_Admins(index, szBufNotify); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Warn Add: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn); SaveLogFile(szBufLog); #endif } else if(nType == DETECT) { formatex(szBufNotify, charsmax(szBufNotify), "%s Nick^4 %s^3 Detected", NSDPrefix, szName); Send_Notify_Admins(index, szBufNotify); #if defined ENABLE_LOG_FILE formatex(szBufLog, charsmax(szBufLog), "NoSpread Detected: ID [%d] Name [%s] Steam [%s] IP [%s] Warn [%d]", index, szName, szSteam, szAddress, Warn); SaveLogFile(szBufLog); #endif ad_set_client(index, NoSpreadCheck, 0); PunishPlayer(index, NOSPREAD); } } } #if defined ENABLE_LOG_FILE public ad_aim_reset_warn(const index, const ResetType:rType, const Kills, const Shots) { new szBufLog[190], szName[32], szAddress[22], szSteam[33]; get_user_name(index, szName, charsmax(szName)); get_user_ip(index, szAddress, charsmax(szAddress)); get_user_authid(index, szSteam, charsmax(szSteam)); switch(rType) { case KILLED: { formatex(szBufLog, charsmax(szBufLog), "Killed Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills + 1, Shots); SaveLogFile(szBufLog); } case SHOTS: { formatex(szBufLog, charsmax(szBufLog), "Shots Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills, Shots + 1); SaveLogFile(szBufLog); } case TIME: { formatex(szBufLog, charsmax(szBufLog), "Time Reset: ID [%d] Name [%s] Steam [%s] IP [%s] Kills [%d] Shots [%d]", index, szName, szSteam, szAddress, Kills, Shots); SaveLogFile(szBufLog); } } } #endif stock ReadCfg() { new szFilePath[256]; get_localinfo("amxx_configsdir", szFilePath, charsmax(szFilePath)); formatex(szFilePath, charsmax(szFilePath), "%s/%s", szFilePath, configs_file); new FileHandle = fopen(szFilePath, "rt"); if(!FileHandle) { set_fail_state("Error load cfg."); } new szTemp[256], szKey[32], szValue[512], iSection; while(!feof(FileHandle)) { fgets(FileHandle, szTemp, charsmax(szTemp)); trim(szTemp); if (szTemp[0] == '[') { iSection++; continue; } if(!szTemp[0] || szTemp[0] == ';' || szTemp[0] == '/') { continue; } strtok(szTemp, szKey, charsmax(szKey), szValue, charsmax(szValue), '='); trim(szKey); trim(szValue); switch(iSection) { case AIM: { if(equal(szKey, "AIM_DETECTION")) g_iAimDetection = str_to_num(szValue); else if(equal(szKey, "SENS")) g_iAimSens = str_to_num(szValue); else if(equal(szKey, "MULTI_WARN")) g_iAimMultiWarn = str_to_num(szValue); else if(equal(szKey, "NOTIFY_WARNS")) g_iAimNotify = str_to_num(szValue); else if(equal(szKey, "MAX_WARNS")) g_iAimMaxWarns = str_to_num(szValue); else if(equal(szKey, "SHOTS_RESET")) g_iAimShotsReset = str_to_num(szValue); else if(equal(szKey, "KILLS_RESET")) g_iAimKillsReset = str_to_num(szValue); else if(equal(szKey, "TIME_RESET")) g_iAimTimeReset = str_to_num(szValue); } case SPREAD: { if(equal(szKey, "NOSPREAD_DETECTION")) g_iSpreadDetection = str_to_num(szValue); else if(equal(szKey, "NOTIFY_WARNS")) g_iSpreadNotify = str_to_num(szValue); else if(equal(szKey, "MAX_WARNS")) g_iSpreadMaxWarns = str_to_num(szValue); } case PUNISH: { if(equal(szKey, "REASON_AIMBOT")) copy(g_szBanReason[AIMBOT], charsmax(g_szBanReason[]), szValue); else if(equal(szKey, "BAN_TIME_AIMBOT")) g_iBanTime[AIMBOT] = str_to_num(szValue); else if(equal(szKey, "REASON_NOSPREAD")) copy(g_szBanReason[NOSPREAD], charsmax(g_szBanReason[]), szValue); else if(equal(szKey, "BAN_TIME_NOSPREAD")) g_iBanTime[NOSPREAD] = str_to_num(szValue); else if(equal(szKey, "PUNISH_AIMBOT")) copy(g_szBanString[AIMBOT], charsmax(g_szBanString[]), szValue); else if(equal(szKey, "PUNISH_NOSPREAD")) copy(g_szBanString[NOSPREAD], charsmax(g_szBanString[]), szValue); } case SAVE: { if(equal(szKey, "TYPE")) g_iSaveType = str_to_num(szValue); else if(equal(szKey, "AIM_WARNS")) g_iAimSaveWarns = str_to_num(szValue); else if(equal(szKey, "NOSPREAD_WARNS")) g_iSpreadSaveWarns = str_to_num(szValue); } case OTHER: { if(equal(szKey, "FLAG_ALERT")) { new szFlags[21]; copy(szFlags, charsmax(szFlags), szValue); g_iAlertFlag = read_flags(szFlags); } else if(equal(szKey, "SEND_PROTECTION_WEAPON")) g_iSendProtectionWeapon = str_to_num(szValue); else if(equal(szKey, "CRASH_CHEAT")) g_iCrashCheat = str_to_num(szValue); } } } fclose(FileHandle); SetCfg(); return PLUGIN_CONTINUE; } stock SetCfg() { ad_set_cfg(AimDetection, g_iAimDetection); ad_set_cfg(AimSens, g_iAimSens); ad_set_cfg(AimMultiWarns, g_iAimMultiWarn); ad_set_cfg(AimNotifyWarns, g_iAimNotify); ad_set_cfg(AimMaxWarns, g_iAimMaxWarns); ad_set_cfg(AimShotsReset, g_iAimShotsReset); ad_set_cfg(AimKillsReset, g_iAimKillsReset); ad_set_cfg(AimTimeReset, g_iAimTimeReset); ad_set_cfg(NoSpreadDetection, g_iSpreadDetection); ad_set_cfg(NoSpreadNotifyWarns, g_iSpreadNotify); ad_set_cfg(NoSpreadMaxWarns, g_iSpreadMaxWarns); ad_set_cfg(SendProtectionWeapon, g_iSendProtectionWeapon); ad_set_cfg(CrashCheat, g_iCrashCheat); } stock PunishPlayer(id, PunishType:iType) { new szUserId[10], szSteam[33], szIp[17], szTime[10], szBanString[128]; formatex(szUserId, charsmax(szUserId), "#%d", get_user_userid(id)); get_user_authid(id, szSteam, charsmax(szSteam)); get_user_ip(id, szIp, charsmax(szIp), 1); num_to_str(g_iBanTime[iType], szTime, charsmax(szTime)); copy(szBanString, charsmax(szBanString), g_szBanString[iType]); replace_string(szBanString, charsmax(szBanString), "[userid]", szUserId); replace_string(szBanString, charsmax(szBanString), "[steam]", szSteam); replace_string(szBanString, charsmax(szBanString), "[ip]", szIp); replace_string(szBanString, charsmax(szBanString), "[reason]", g_szBanReason[iType]); replace_string(szBanString, charsmax(szBanString), "[time]", szTime); server_cmd("%s", szBanString); } stock Send_Notify_Admins(const NotifyIndex, const Msg[]) { new Players[MAX_PLAYERS], iNum, iReceiver; get_players(Players, iNum, "ch"); for (new i = 0; i < iNum; ++i) { iReceiver = Players[i]; if(NotifyIndex == iReceiver || !(get_user_flags(iReceiver) & g_iAlertFlag)) { continue; } client_print_color(iReceiver, print_team_default, Msg); } } #if defined ENABLE_LOG_FILE stock SaveLogFile(const LogText[]) { new LogFileTime[32], LogTime[32], LogFile[128], LogMsg[190]; get_time("20%y.%m.%d", LogFileTime, charsmax(LogFileTime)); get_time("%H:%M:%S", LogTime, charsmax(LogTime)); formatex(LogFile, charsmax(LogFile), "%s/%s.log", g_LogDir, LogFileTime); formatex(LogMsg, charsmax(LogMsg), "[%s] [%s] %s", LogFileTime, LogTime, LogText); write_file(LogFile, LogMsg, -1); } #endif #if (AMXX_VERSION_NUM < 183) stock client_print_color(const id, const iSender, const input[], any:...) { static iSayText = 0; if (!iSayText) { iSayText = get_user_msgid("SayText"); } new iReceiver, iNum = 1, Players[MAX_PLAYERS], Msg[190]; vformat(Msg, charsmax(Msg), input, 3); if(id) { if(!is_user_connected(id)) { return; } Players[0] = id; } else { get_players(Players, iNum, "ch"); } for (new i = 0; i < iNum; i++) { iReceiver = Players[i]; message_begin(MSG_ONE, iSayText , _, iReceiver); write_byte(iSender ? iSender : iReceiver); write_string(Msg); message_end(); } } #endif
अंतर खोजें