bunda şey hocam önce sorunsuz 3 defa zıplaıdm blokladı 1sn bekledim zıplayabildim sonraki artık hiç zıplanmadı 15-20 sn bile bekledim 1. zıplayışta bile blokladı. Ben bundan bir önceki gönderdiğinize diğer bilgisayardan bakmıştım tam anlamamıştım sizi yordum ama şimdi asıl bilgisayardan baktım sanki bu işimi görüyor hocam bi tam test edip dönüş yapayım sizeomertas14544 yazdı: Sal Ara 22, 2020 4:42 pm1 saniye boyunca bunny yapamaz. Dener misin ?Kod: Tümünü seç
#include <amxmodx> #include <reapi> new Float:JumpDelay[MAX_CLIENTS+1]; new Float:TotalJump[MAX_CLIENTS+1]; public plugin_init() { register_plugin("[ReAPI] - PreJump Blocker","0.1","Leeyé"); RegisterHookChain(RG_CBasePlayer_Jump,"PlayerJumped",0); } public PlayerJumped(const id) { if(~get_entvar(id,var_flags) & FL_ONGROUND) { return } if(JumpDelay[id] >= get_gametime()+2.4) { new Float:velocity[3]; get_entvar(id,var_velocity,velocity); velocity[0] = (velocity[0]/3.0) velocity[1] = (velocity[1]/3.0) velocity[2] = (velocity[1]/3.0) set_entvar(id,var_velocity,velocity); TotalJump[id] = 0.0; JumpDelay[id]+=1.0 } else { TotalJump[id]+=0.8 remove_task(id); set_task(0.8,"TotalJumpD",id); JumpDelay[id] = get_gametime()+TotalJump[id]; } } public TotalJumpD(const id) { if(is_user_connected(id)) { TotalJump[id]-=0.8 } } public client_disconnected(id) { TotalJump[id] = 0.0 }
bunny engelleme
Moderatör: Moderatörler
-
Victores
Konu Sahibi - Mesajlar: 188
- Kayıt: Çrş May 27, 2020 8:58 pm
bunny engelleme
| Link: | |
| Linklerini gizle |
-
ulyoS
- Mesajlar: 4526
- Kayıt: Cum Ara 16, 2016 2:14 pm
- Konum: İzmir
bunny engelleme
6 sayfa mesaj olmuş, ilk istediğiniz strafe hack kullananlar için zamanında kullandığım bir eklentiyi kod bloğu içerisinde bırakıyorum. Güncel olarak tam ne istediğinizi maalesef okuma fırsatım olmadı.
Kod: Tümünü seç
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#define PLUGIN "StrafeHack Detector"
#define VERSION "0.1"
#define AUTHOR "Mistrick"
#pragma semicolon 1
const PITCH = 0;
const YAW = 1;
const LEFT = 1;
const RIGHT = 2;
stock const m_afButtonPressed = 246;
stock const m_afButtonReleased = 247;
stock const m_pPlayer = 41;
stock const XO_CBASEPLAYER = 5;
stock const XO_CBASEPLAYERWEAPON = 4;
#define LOGFILE "strafehack_detector.log"
#define MIN_LOG_TIME 3.0
#define MAX_BADFRAMES 5
#define MAX_KEYWARNING 5
#define MAX_STRAFES 16
#define STRAFE_CHECK_TIME 0.2
#define MAX_ANGLE_CHECK 90.0
#define MIN_STRAFE_ANGLE_DIFF 1.0
#define MAX_STRAFE_ANGLE_WARNINGS 15
#define MIN_STRAFE_ANGLE_WARNINGS_TO_LOG 5
#define IGNORE_TIME 0.5
enum _:PLAYER_DATA
{
m_BadFrame,
m_Strafes,
m_WarningStrafeAngle,
Float:m_fLastStrafeCheck,
Float:m_fLastWeaponDeploy
};
new g_ePlayerInfo[33][PLAYER_DATA];
enum _:LOG_DATA
{
Float:m_LastForwardMoveLog,
Float:m_LastSideMoveLog,
Float:m_LastValueLog,
Float:m_LastKeyLog,
Float:m_LastStrafeAngleLog,
Float:m_LastChatLog,
m_CountForwardMoveLog,
m_CountSideMoveLog,
m_CountValueLog,
m_CountKeyLog,
m_CountStrafeAngleLog,
m_CountChatLog
};
new g_ePlayerLog[33][LOG_DATA];
enum _:KEYS
{
KEY_W, KEY_S, KEY_A, KEY_D
}
enum _:BUTTONS_DATA
{
BUTTON, KEY
}
new g_ePlayerButtons[][BUTTONS_DATA] =
{
{IN_FORWARD, KEY_W}, {IN_BACK, KEY_S}, {IN_MOVELEFT, KEY_A}, {IN_MOVERIGHT, KEY_D}
};
new g_szKeyName[KEYS][] =
{
"[W]", "[S]", "[A]", "[D]"
};
new g_iKeyFrames[33][KEYS], g_iOldKeyFrames[33][KEYS], g_iKeyWarning[33][KEYS];
new Float:g_fOldAngles[33][3];
new g_iOldTurning[33];
new Float:g_fOldStrafeAngles[33][3];
new Float:g_fOldAnglesDiff[33];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_CmdStart, "FM_CmdStart_Pre", false);
register_forward(FM_PlayerPreThink, "FM_PlayerPreThink_Pre", false);
for(new iId = CSW_P228, szWeaponName[32]; iId <= CSW_P90; iId++)
{
if(get_weaponname(iId, szWeaponName, charsmax(szWeaponName)))
{
RegisterHam(Ham_Item_Deploy, szWeaponName, "Ham_Item_Deploy_Pre", false);
}
}
}
public Ham_Item_Deploy_Pre(weapon)
{
new id = get_pdata_cbase(weapon, m_pPlayer, XO_CBASEPLAYERWEAPON);
g_ePlayerInfo[id][m_fLastWeaponDeploy] = _:get_gametime();
}
public FM_CmdStart_Pre(id, uc_handle, seed)
{
if(!is_user_alive(id)) return FMRES_IGNORED;
new Float:fForwardMove; get_uc(uc_handle, UC_ForwardMove, fForwardMove);
new Float:fSideMove; get_uc(uc_handle, UC_SideMove, fSideMove);
if(fForwardMove == 0.0 && fSideMove == 0.0) return FMRES_IGNORED;
new Float:fTime = get_gametime();
if(fTime < g_ePlayerInfo[id][m_fLastWeaponDeploy] + IGNORE_TIME) return FMRES_IGNORED;
new bBlockSpeed = false;
new bButtons = get_uc(uc_handle, UC_Buttons);
new Float:fAngles[3]; pev(id, pev_angles, fAngles);
new Float:fAnglesDiff[3]; vec_diff(fAnglesDiff, fAngles, g_fOldAngles[id]);
new Float:fValue = floatsqroot(fForwardMove * fForwardMove + fSideMove * fSideMove);
if(!(equal_null(fAnglesDiff) && fValue > 115.0))
{
// forwardmove without button
if((fForwardMove > 0.0 && ~bButtons & IN_FORWARD || fForwardMove < 0.0 && ~bButtons & IN_BACK) && fAnglesDiff[PITCH] != 0.0)
{
bBlockSpeed = true;
if(fTime >= g_ePlayerLog[id][m_LastForwardMoveLog])
{
g_ePlayerLog[id][m_LastForwardMoveLog] = _:(fTime + MIN_LOG_TIME);
UTIL_LogUser(id, "CheatMoves: [%d] forward move without button[%.1f]", g_ePlayerLog[id][m_CountForwardMoveLog], fForwardMove);
g_ePlayerLog[id][m_CountForwardMoveLog] = 0;
}
g_ePlayerLog[id][m_CountForwardMoveLog]++;
}
// sidemove without button
if(fSideMove > 0.0 && ~bButtons & IN_MOVERIGHT || fSideMove < 0.0 && ~bButtons & IN_MOVELEFT)
{
bBlockSpeed = true;
if(fTime >= g_ePlayerLog[id][m_LastSideMoveLog])
{
g_ePlayerLog[id][m_LastSideMoveLog] = _:(fTime + MIN_LOG_TIME);
UTIL_LogUser(id, "CheatMoves: [%d] side move without button[%.1f]", g_ePlayerLog[id][m_CountSideMoveLog], fSideMove);
g_ePlayerLog[id][m_CountSideMoveLog] = 0;
}
g_ePlayerLog[id][m_CountSideMoveLog]++;
}
}
new Float:fMaxSpeed = get_user_maxspeed(id);
// value can't be more maxspeed
if(fValue > fMaxSpeed && fMaxSpeed > 100.0)
{
bBlockSpeed = true;
if(fTime >= g_ePlayerLog[id][m_LastValueLog])
{
g_ePlayerLog[id][m_LastValueLog] = _:(fTime + MIN_LOG_TIME);
UTIL_LogUser(id, "CheatMoves: [%d] value[%.1f], fw[%.1f], sd[%.1f], maxspeed[%.1f]", g_ePlayerLog[id][m_CountValueLog], fValue, fForwardMove, fSideMove, fMaxSpeed);
g_ePlayerLog[id][m_CountValueLog] = 0;
}
g_ePlayerLog[id][m_CountValueLog]++;
}
// block scripts with +right, +left
if(bButtons & (IN_LEFT | IN_RIGHT))
{
bBlockSpeed = true;
}
fForwardMove = floatabs(fForwardMove);
fSideMove = floatabs(fSideMove);
// cl_forwardspeed != cl_sidespeed
if(fForwardMove && fSideMove && fForwardMove != fSideMove)
{
if(++g_ePlayerInfo[id][m_BadFrame] >= MAX_BADFRAMES)
{
bBlockSpeed = true;
g_ePlayerInfo[id][m_BadFrame] = 0;
}
}
else
{
g_ePlayerInfo[id][m_BadFrame] = 0;
}
new iTurning = 0;
new Float:fDiff = fAngles[YAW] - g_fOldAngles[id][YAW];
if(fDiff >= 180.0) fDiff -= 360.0;
if(fDiff < -180.0) fDiff += 360.0;
if(fDiff < 0.0)
{
iTurning = RIGHT;
if(g_iOldTurning[id] == LEFT)
{
g_ePlayerInfo[id][m_Strafes]++;
StrafeForward(id, fAngles);
}
}
else if(fDiff > 0.0)
{
iTurning = LEFT;
if(g_iOldTurning[id] == RIGHT)
{
g_ePlayerInfo[id][m_Strafes]++;
StrafeForward(id, fAngles);
}
}
if(fTime >= g_ePlayerInfo[id][m_fLastStrafeCheck])
{
if(g_ePlayerInfo[id][m_Strafes] >= MAX_STRAFES)
{
bBlockSpeed = true;
UTIL_LogUser(id, "CheatStrafes: %d strafes in %.1f sec", g_ePlayerInfo[id][m_Strafes], STRAFE_CHECK_TIME);
}
g_ePlayerInfo[id][m_Strafes] = 0;
g_ePlayerInfo[id][m_fLastStrafeCheck] = _:(fTime + STRAFE_CHECK_TIME);
}
g_iOldTurning[id] = iTurning;
if(bBlockSpeed)
{
new Float:fVelocity[3]; pev(id, pev_velocity, fVelocity);
fVelocity[0] *= 0.2; fVelocity[1] *= 0.2;
set_pev(id, pev_velocity, fVelocity);
}
g_fOldAngles[id] = fAngles;
return FMRES_IGNORED;
}
public FM_PlayerPreThink_Pre(id)
{
if(!is_user_alive(id)) return FMRES_IGNORED;
new bBlockSpeed = false;
new bButtons = pev(id, pev_button);
new bOldButton = pev(id, pev_oldbuttons);
for(new i; i < sizeof(g_ePlayerButtons); i++)
{
new CheckButton = g_ePlayerButtons[i][BUTTON];
new CheckKey = g_ePlayerButtons[i][KEY];
if(bButtons & CheckButton)
{
g_iKeyFrames[id][CheckKey]++;
}
if(~bButtons & CheckButton && bOldButton & CheckButton)
{
if(g_iKeyFrames[id][CheckKey] == g_iOldKeyFrames[id][CheckKey])
{
if(g_iKeyFrames[id][CheckKey] == 1) g_iKeyWarning[id][CheckKey]++;
if(++g_iKeyWarning[id][CheckKey] >= MAX_KEYWARNING)
{
bBlockSpeed = true;
g_iKeyWarning[id][CheckKey] = 0;
new Float:fTime = get_gametime();
if(fTime >= g_ePlayerLog[id][m_LastKeyLog])
{
g_ePlayerLog[id][m_LastKeyLog] = _:(fTime + MIN_LOG_TIME);
UTIL_LogUser(id, "CheatKeys: [%d] keyframe agreement[%d], key %s", g_ePlayerLog[id][m_CountKeyLog], g_iKeyFrames[id][CheckKey], g_szKeyName[CheckKey]);
g_ePlayerLog[id][m_CountKeyLog] = 0;
}
g_ePlayerLog[id][m_CountKeyLog]++;
}
}
else if(g_iKeyWarning[id][CheckKey])
{
g_iKeyWarning[id][CheckKey]--;
}
//console_print(id, "key frame %s is %d, warn [%d]", g_szKeyName[CheckKey], g_iKeyFrames[id][CheckKey], g_iKeyWarning[id][CheckKey]);
g_iOldKeyFrames[id][CheckKey] = g_iKeyFrames[id][CheckKey];
g_iKeyFrames[id][CheckKey] = 0;
}
}
if(bBlockSpeed)
{
new Float:fVelocity[3]; pev(id, pev_velocity, fVelocity);
fVelocity[0] *= 0.2; fVelocity[1] *= 0.2;
set_pev(id, pev_velocity, fVelocity);
}
return FMRES_IGNORED;
}
StrafeForward(id, Float:angles[3])
{
new Float:fAnglesDiff[3]; vec_diff(fAnglesDiff, angles, g_fOldStrafeAngles[id]);
if(fAnglesDiff[YAW] >= 180) fAnglesDiff[YAW] -= 360.0;
if(fAnglesDiff[YAW] < -180) fAnglesDiff[YAW] += 360.0;
fAnglesDiff[YAW] = floatabs(fAnglesDiff[YAW]);
//console_print(id, "strafe angle diff %f, old angle diff %f, turning [%d]", fAnglesDiff[YAW], g_fOldAnglesDiff[id], turning);
if(fAnglesDiff[YAW] < MAX_ANGLE_CHECK)
{
new Float:fDiff = floatabs(fAnglesDiff[YAW] - g_fOldAnglesDiff[id]);
new iOldWarn = g_ePlayerInfo[id][m_WarningStrafeAngle];
if( fDiff < 0.1 )
{
g_ePlayerInfo[id][m_WarningStrafeAngle] += 5;
}
else if( fDiff < MIN_STRAFE_ANGLE_DIFF )
{
g_ePlayerInfo[id][m_WarningStrafeAngle]++;
}
else if(g_ePlayerInfo[id][m_WarningStrafeAngle])
{
g_ePlayerInfo[id][m_WarningStrafeAngle]--;
}
new Float:fTime = get_gametime();
if(g_ePlayerInfo[id][m_WarningStrafeAngle] > iOldWarn)
{
//console_print(id, " time %f, last time %f, count %d", fTime, g_ePlayerLog[id][m_LastStrafeAngleLog], g_ePlayerLog[id][m_CountStrafeAngleLog]);
if( fTime <= g_ePlayerLog[id][m_LastStrafeAngleLog] + MIN_LOG_TIME)
{
if(++g_ePlayerLog[id][m_CountStrafeAngleLog] >= MIN_STRAFE_ANGLE_WARNINGS_TO_LOG)
{
UTIL_LogUser(id, "CheatStrafes: diff %f, cur angle %f, old angle %f", fDiff, fAnglesDiff[YAW], g_fOldAnglesDiff[id]);
}
}
else
{
g_ePlayerLog[id][m_CountStrafeAngleLog] = 0;
}
g_ePlayerLog[id][m_LastStrafeAngleLog] = _:fTime;
}
if(g_ePlayerInfo[id][m_WarningStrafeAngle] >= MAX_STRAFE_ANGLE_WARNINGS)
{
if(fTime >= g_ePlayerLog[id][m_LastChatLog])
{
g_ePlayerLog[id][m_LastChatLog] = _:(fTime + MIN_LOG_TIME);
PunishPlayer(id, "StrafeMacros");
UTIL_LogUser(id, "CheatStrafes: [%d] using macros", g_ePlayerLog[id][m_CountChatLog]);
g_ePlayerLog[id][m_CountChatLog] = 0;
}
g_ePlayerLog[id][m_CountChatLog]++;
g_ePlayerInfo[id][m_WarningStrafeAngle] = 0;
}
}
g_fOldAnglesDiff[id] = fAnglesDiff[YAW];
g_fOldStrafeAngles[id] = angles;
}
vec_diff(Float:vec[3], Float:new_vec[3], Float:old_vec[3])
{
vec[0] = new_vec[0] - old_vec[0];
vec[1] = new_vec[1] - old_vec[1];
vec[2] = new_vec[2] - old_vec[2];
}
equal_null(Float:vec[3])
{
return (vec[0] == 0.0 && vec[1] == 0.0) ? true : false;
}
stock PunishPlayer(id, reason[])
{
new szName[32]; get_user_name(id, szName, charsmax(szName));
client_print(0, print_chat, "[SHD] %s using %s.", szName, reason);
}
stock UTIL_LogUser(const id, const szCvar[], any:...)
{
static szLogFile[128];
if(!szLogFile[0])
{
get_localinfo("amxx_logs", szLogFile, charsmax(szLogFile));
format(szLogFile, charsmax(szLogFile), "/%s/%s", szLogFile, LOGFILE);
}
new iFile;
if( (iFile = fopen(szLogFile, "a")) )
{
new szName[32], szAuthid[32], szIp[32], szTime[22];
new message[128]; vformat(message, charsmax(message), szCvar, 3);
get_user_name(id, szName, charsmax(szName));
get_user_authid(id, szAuthid, charsmax(szAuthid));
get_user_ip(id, szIp, charsmax(szIp), 1);
get_time("%m/%d/%Y - %H:%M:%S", szTime, charsmax(szTime));
fprintf(iFile, "L %s: <%s><%s><%s> %s^n", szTime, szName, szAuthid, szIp, message);
fclose(iFile);
}
}
| Link: | |
| Linklerini gizle |
-
Victores
Konu Sahibi - Mesajlar: 188
- Kayıt: Çrş May 27, 2020 8:58 pm
bunny engelleme
bunu görüp denemiştimulyoS yazdı: Sal Ara 22, 2020 9:07 pm 6 sayfa mesaj olmuş, ilk istediğiniz strafe hack kullananlar için zamanında kullandığım bir eklentiyi kod bloğu içerisinde bırakıyorum. Güncel olarak tam ne istediğinizi maalesef okuma fırsatım olmadı.
Kod: Tümünü seç
#include <amxmodx> #include <engine> #include <fakemeta> #include <fun> #include <hamsandwich> #define PLUGIN "StrafeHack Detector" #define VERSION "0.1" #define AUTHOR "Mistrick" #pragma semicolon 1 const PITCH = 0; const YAW = 1; const LEFT = 1; const RIGHT = 2; stock const m_afButtonPressed = 246; stock const m_afButtonReleased = 247; stock const m_pPlayer = 41; stock const XO_CBASEPLAYER = 5; stock const XO_CBASEPLAYERWEAPON = 4; #define LOGFILE "strafehack_detector.log" #define MIN_LOG_TIME 3.0 #define MAX_BADFRAMES 5 #define MAX_KEYWARNING 5 #define MAX_STRAFES 16 #define STRAFE_CHECK_TIME 0.2 #define MAX_ANGLE_CHECK 90.0 #define MIN_STRAFE_ANGLE_DIFF 1.0 #define MAX_STRAFE_ANGLE_WARNINGS 15 #define MIN_STRAFE_ANGLE_WARNINGS_TO_LOG 5 #define IGNORE_TIME 0.5 enum _:PLAYER_DATA { m_BadFrame, m_Strafes, m_WarningStrafeAngle, Float:m_fLastStrafeCheck, Float:m_fLastWeaponDeploy }; new g_ePlayerInfo[33][PLAYER_DATA]; enum _:LOG_DATA { Float:m_LastForwardMoveLog, Float:m_LastSideMoveLog, Float:m_LastValueLog, Float:m_LastKeyLog, Float:m_LastStrafeAngleLog, Float:m_LastChatLog, m_CountForwardMoveLog, m_CountSideMoveLog, m_CountValueLog, m_CountKeyLog, m_CountStrafeAngleLog, m_CountChatLog }; new g_ePlayerLog[33][LOG_DATA]; enum _:KEYS { KEY_W, KEY_S, KEY_A, KEY_D } enum _:BUTTONS_DATA { BUTTON, KEY } new g_ePlayerButtons[][BUTTONS_DATA] = { {IN_FORWARD, KEY_W}, {IN_BACK, KEY_S}, {IN_MOVELEFT, KEY_A}, {IN_MOVERIGHT, KEY_D} }; new g_szKeyName[KEYS][] = { "[W]", "[S]", "[A]", "[D]" }; new g_iKeyFrames[33][KEYS], g_iOldKeyFrames[33][KEYS], g_iKeyWarning[33][KEYS]; new Float:g_fOldAngles[33][3]; new g_iOldTurning[33]; new Float:g_fOldStrafeAngles[33][3]; new Float:g_fOldAnglesDiff[33]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_forward(FM_CmdStart, "FM_CmdStart_Pre", false); register_forward(FM_PlayerPreThink, "FM_PlayerPreThink_Pre", false); for(new iId = CSW_P228, szWeaponName[32]; iId <= CSW_P90; iId++) { if(get_weaponname(iId, szWeaponName, charsmax(szWeaponName))) { RegisterHam(Ham_Item_Deploy, szWeaponName, "Ham_Item_Deploy_Pre", false); } } } public Ham_Item_Deploy_Pre(weapon) { new id = get_pdata_cbase(weapon, m_pPlayer, XO_CBASEPLAYERWEAPON); g_ePlayerInfo[id][m_fLastWeaponDeploy] = _:get_gametime(); } public FM_CmdStart_Pre(id, uc_handle, seed) { if(!is_user_alive(id)) return FMRES_IGNORED; new Float:fForwardMove; get_uc(uc_handle, UC_ForwardMove, fForwardMove); new Float:fSideMove; get_uc(uc_handle, UC_SideMove, fSideMove); if(fForwardMove == 0.0 && fSideMove == 0.0) return FMRES_IGNORED; new Float:fTime = get_gametime(); if(fTime < g_ePlayerInfo[id][m_fLastWeaponDeploy] + IGNORE_TIME) return FMRES_IGNORED; new bBlockSpeed = false; new bButtons = get_uc(uc_handle, UC_Buttons); new Float:fAngles[3]; pev(id, pev_angles, fAngles); new Float:fAnglesDiff[3]; vec_diff(fAnglesDiff, fAngles, g_fOldAngles[id]); new Float:fValue = floatsqroot(fForwardMove * fForwardMove + fSideMove * fSideMove); if(!(equal_null(fAnglesDiff) && fValue > 115.0)) { // forwardmove without button if((fForwardMove > 0.0 && ~bButtons & IN_FORWARD || fForwardMove < 0.0 && ~bButtons & IN_BACK) && fAnglesDiff[PITCH] != 0.0) { bBlockSpeed = true; if(fTime >= g_ePlayerLog[id][m_LastForwardMoveLog]) { g_ePlayerLog[id][m_LastForwardMoveLog] = _:(fTime + MIN_LOG_TIME); UTIL_LogUser(id, "CheatMoves: [%d] forward move without button[%.1f]", g_ePlayerLog[id][m_CountForwardMoveLog], fForwardMove); g_ePlayerLog[id][m_CountForwardMoveLog] = 0; } g_ePlayerLog[id][m_CountForwardMoveLog]++; } // sidemove without button if(fSideMove > 0.0 && ~bButtons & IN_MOVERIGHT || fSideMove < 0.0 && ~bButtons & IN_MOVELEFT) { bBlockSpeed = true; if(fTime >= g_ePlayerLog[id][m_LastSideMoveLog]) { g_ePlayerLog[id][m_LastSideMoveLog] = _:(fTime + MIN_LOG_TIME); UTIL_LogUser(id, "CheatMoves: [%d] side move without button[%.1f]", g_ePlayerLog[id][m_CountSideMoveLog], fSideMove); g_ePlayerLog[id][m_CountSideMoveLog] = 0; } g_ePlayerLog[id][m_CountSideMoveLog]++; } } new Float:fMaxSpeed = get_user_maxspeed(id); // value can't be more maxspeed if(fValue > fMaxSpeed && fMaxSpeed > 100.0) { bBlockSpeed = true; if(fTime >= g_ePlayerLog[id][m_LastValueLog]) { g_ePlayerLog[id][m_LastValueLog] = _:(fTime + MIN_LOG_TIME); UTIL_LogUser(id, "CheatMoves: [%d] value[%.1f], fw[%.1f], sd[%.1f], maxspeed[%.1f]", g_ePlayerLog[id][m_CountValueLog], fValue, fForwardMove, fSideMove, fMaxSpeed); g_ePlayerLog[id][m_CountValueLog] = 0; } g_ePlayerLog[id][m_CountValueLog]++; } // block scripts with +right, +left if(bButtons & (IN_LEFT | IN_RIGHT)) { bBlockSpeed = true; } fForwardMove = floatabs(fForwardMove); fSideMove = floatabs(fSideMove); // cl_forwardspeed != cl_sidespeed if(fForwardMove && fSideMove && fForwardMove != fSideMove) { if(++g_ePlayerInfo[id][m_BadFrame] >= MAX_BADFRAMES) { bBlockSpeed = true; g_ePlayerInfo[id][m_BadFrame] = 0; } } else { g_ePlayerInfo[id][m_BadFrame] = 0; } new iTurning = 0; new Float:fDiff = fAngles[YAW] - g_fOldAngles[id][YAW]; if(fDiff >= 180.0) fDiff -= 360.0; if(fDiff < -180.0) fDiff += 360.0; if(fDiff < 0.0) { iTurning = RIGHT; if(g_iOldTurning[id] == LEFT) { g_ePlayerInfo[id][m_Strafes]++; StrafeForward(id, fAngles); } } else if(fDiff > 0.0) { iTurning = LEFT; if(g_iOldTurning[id] == RIGHT) { g_ePlayerInfo[id][m_Strafes]++; StrafeForward(id, fAngles); } } if(fTime >= g_ePlayerInfo[id][m_fLastStrafeCheck]) { if(g_ePlayerInfo[id][m_Strafes] >= MAX_STRAFES) { bBlockSpeed = true; UTIL_LogUser(id, "CheatStrafes: %d strafes in %.1f sec", g_ePlayerInfo[id][m_Strafes], STRAFE_CHECK_TIME); } g_ePlayerInfo[id][m_Strafes] = 0; g_ePlayerInfo[id][m_fLastStrafeCheck] = _:(fTime + STRAFE_CHECK_TIME); } g_iOldTurning[id] = iTurning; if(bBlockSpeed) { new Float:fVelocity[3]; pev(id, pev_velocity, fVelocity); fVelocity[0] *= 0.2; fVelocity[1] *= 0.2; set_pev(id, pev_velocity, fVelocity); } g_fOldAngles[id] = fAngles; return FMRES_IGNORED; } public FM_PlayerPreThink_Pre(id) { if(!is_user_alive(id)) return FMRES_IGNORED; new bBlockSpeed = false; new bButtons = pev(id, pev_button); new bOldButton = pev(id, pev_oldbuttons); for(new i; i < sizeof(g_ePlayerButtons); i++) { new CheckButton = g_ePlayerButtons[i][BUTTON]; new CheckKey = g_ePlayerButtons[i][KEY]; if(bButtons & CheckButton) { g_iKeyFrames[id][CheckKey]++; } if(~bButtons & CheckButton && bOldButton & CheckButton) { if(g_iKeyFrames[id][CheckKey] == g_iOldKeyFrames[id][CheckKey]) { if(g_iKeyFrames[id][CheckKey] == 1) g_iKeyWarning[id][CheckKey]++; if(++g_iKeyWarning[id][CheckKey] >= MAX_KEYWARNING) { bBlockSpeed = true; g_iKeyWarning[id][CheckKey] = 0; new Float:fTime = get_gametime(); if(fTime >= g_ePlayerLog[id][m_LastKeyLog]) { g_ePlayerLog[id][m_LastKeyLog] = _:(fTime + MIN_LOG_TIME); UTIL_LogUser(id, "CheatKeys: [%d] keyframe agreement[%d], key %s", g_ePlayerLog[id][m_CountKeyLog], g_iKeyFrames[id][CheckKey], g_szKeyName[CheckKey]); g_ePlayerLog[id][m_CountKeyLog] = 0; } g_ePlayerLog[id][m_CountKeyLog]++; } } else if(g_iKeyWarning[id][CheckKey]) { g_iKeyWarning[id][CheckKey]--; } //console_print(id, "key frame %s is %d, warn [%d]", g_szKeyName[CheckKey], g_iKeyFrames[id][CheckKey], g_iKeyWarning[id][CheckKey]); g_iOldKeyFrames[id][CheckKey] = g_iKeyFrames[id][CheckKey]; g_iKeyFrames[id][CheckKey] = 0; } } if(bBlockSpeed) { new Float:fVelocity[3]; pev(id, pev_velocity, fVelocity); fVelocity[0] *= 0.2; fVelocity[1] *= 0.2; set_pev(id, pev_velocity, fVelocity); } return FMRES_IGNORED; } StrafeForward(id, Float:angles[3]) { new Float:fAnglesDiff[3]; vec_diff(fAnglesDiff, angles, g_fOldStrafeAngles[id]); if(fAnglesDiff[YAW] >= 180) fAnglesDiff[YAW] -= 360.0; if(fAnglesDiff[YAW] < -180) fAnglesDiff[YAW] += 360.0; fAnglesDiff[YAW] = floatabs(fAnglesDiff[YAW]); //console_print(id, "strafe angle diff %f, old angle diff %f, turning [%d]", fAnglesDiff[YAW], g_fOldAnglesDiff[id], turning); if(fAnglesDiff[YAW] < MAX_ANGLE_CHECK) { new Float:fDiff = floatabs(fAnglesDiff[YAW] - g_fOldAnglesDiff[id]); new iOldWarn = g_ePlayerInfo[id][m_WarningStrafeAngle]; if( fDiff < 0.1 ) { g_ePlayerInfo[id][m_WarningStrafeAngle] += 5; } else if( fDiff < MIN_STRAFE_ANGLE_DIFF ) { g_ePlayerInfo[id][m_WarningStrafeAngle]++; } else if(g_ePlayerInfo[id][m_WarningStrafeAngle]) { g_ePlayerInfo[id][m_WarningStrafeAngle]--; } new Float:fTime = get_gametime(); if(g_ePlayerInfo[id][m_WarningStrafeAngle] > iOldWarn) { //console_print(id, " time %f, last time %f, count %d", fTime, g_ePlayerLog[id][m_LastStrafeAngleLog], g_ePlayerLog[id][m_CountStrafeAngleLog]); if( fTime <= g_ePlayerLog[id][m_LastStrafeAngleLog] + MIN_LOG_TIME) { if(++g_ePlayerLog[id][m_CountStrafeAngleLog] >= MIN_STRAFE_ANGLE_WARNINGS_TO_LOG) { UTIL_LogUser(id, "CheatStrafes: diff %f, cur angle %f, old angle %f", fDiff, fAnglesDiff[YAW], g_fOldAnglesDiff[id]); } } else { g_ePlayerLog[id][m_CountStrafeAngleLog] = 0; } g_ePlayerLog[id][m_LastStrafeAngleLog] = _:fTime; } if(g_ePlayerInfo[id][m_WarningStrafeAngle] >= MAX_STRAFE_ANGLE_WARNINGS) { if(fTime >= g_ePlayerLog[id][m_LastChatLog]) { g_ePlayerLog[id][m_LastChatLog] = _:(fTime + MIN_LOG_TIME); PunishPlayer(id, "StrafeMacros"); UTIL_LogUser(id, "CheatStrafes: [%d] using macros", g_ePlayerLog[id][m_CountChatLog]); g_ePlayerLog[id][m_CountChatLog] = 0; } g_ePlayerLog[id][m_CountChatLog]++; g_ePlayerInfo[id][m_WarningStrafeAngle] = 0; } } g_fOldAnglesDiff[id] = fAnglesDiff[YAW]; g_fOldStrafeAngles[id] = angles; } vec_diff(Float:vec[3], Float:new_vec[3], Float:old_vec[3]) { vec[0] = new_vec[0] - old_vec[0]; vec[1] = new_vec[1] - old_vec[1]; vec[2] = new_vec[2] - old_vec[2]; } equal_null(Float:vec[3]) { return (vec[0] == 0.0 && vec[1] == 0.0) ? true : false; } stock PunishPlayer(id, reason[]) { new szName[32]; get_user_name(id, szName, charsmax(szName)); client_print(0, print_chat, "[SHD] %s using %s.", szName, reason); } stock UTIL_LogUser(const id, const szCvar[], any:...) { static szLogFile[128]; if(!szLogFile[0]) { get_localinfo("amxx_logs", szLogFile, charsmax(szLogFile)); format(szLogFile, charsmax(szLogFile), "/%s/%s", szLogFile, LOGFILE); } new iFile; if( (iFile = fopen(szLogFile, "a")) ) { new szName[32], szAuthid[32], szIp[32], szTime[22]; new message[128]; vformat(message, charsmax(message), szCvar, 3); get_user_name(id, szName, charsmax(szName)); get_user_authid(id, szAuthid, charsmax(szAuthid)); get_user_ip(id, szIp, charsmax(szIp), 1); get_time("%m/%d/%Y - %H:%M:%S", szTime, charsmax(szTime)); fprintf(iFile, "L %s: <%s><%s><%s> %s^n", szTime, szName, szAuthid, szIp, message); fclose(iFile); } }
| Link: | |
| Linklerini gizle |