- Joined
- Aug 19, 2006
- Messages
- 106
- Reaction score
- 162
Hello,
today i will share my afk kicker, it will kick any afk leveler in 15 mins.
don't worry it will not affect players sitting in cities, safe zones, shops .. etc
dll is attached.
Source:
if you want to change kick time search for 900000 and change it for something else.
have fun.
today i will share my afk kicker, it will kick any afk leveler in 15 mins.
don't worry it will not affect players sitting in cities, safe zones, shops .. etc
dll is attached.
Source:
Code:
#pragma comment(lib, "detours.lib")
#undef UNICODE
#include <windows.h>
#include <detours.h>
#include<stdio.h>
#include<iostream>
#include<map>
struct afk{
ULONGLONG cd;
DWORD x;
DWORD y;
DWORD z;
};
std::map<DWORD, afk> afkMap;
static void (__thiscall *sub_495B20)(DWORD a4,signed int a5) = (void (__thiscall*)(DWORD a4,signed int a5))0x00495B20;
static signed int(__thiscall *ApplyDamage)(void* _this, int a5, int a6, int a7, int a8, int a9, int a10, int a11) = (signed int(__thiscall*)(void*, int a5, int a6, int a7, int a8, int a9, int a10, int a11))0x0043E950;
void __fastcall ApplyDamage_hooked(void *_this,void *_edx,int Player, int a3, int Damage, int a5, int a6, int a7, int a8)
{
int* PlayerArray = (int*)Player;
DWORD x = *(DWORD *)(PlayerArray + 83);
DWORD y = *(DWORD *)(PlayerArray + 84);
DWORD z = *(DWORD *)(PlayerArray + 85);
DWORD pid = *(DWORD *)(PlayerArray + 113);
if(afkMap[pid].x != x || afkMap[pid].y != y){
afkMap[pid].x = x;
afkMap[pid].y = y;
afkMap[pid].cd = GetTickCount64();
}
if(GetTickCount64() > (afkMap[pid].cd + 900000)){
Server::CPlayer::Write(PlayerArray, 60, "ss", "Server", "you have been kicked for AFK leveling!");
Server::CChar::Write(PlayerArray,0x2D,"b",1);
sub_495B20(*((DWORD *)PlayerArray + 419), 1);
Server::Console::WriteRed("Player: %s Kicked for AFK leveling",(PlayerArray+8));
}
ApplyDamage(_this,Player,a3,Damage,a5,a6,a7,a8);
}
BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&(PVOID&)ApplyDamage, ApplyDamage_hooked);
DetourTransactionCommit();
break;
}
case DLL_PROCESS_DETACH:
{
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourDetach(&(PVOID&)ApplyDamage, ApplyDamage_hooked);
DetourTransactionCommit();
break;
}
}
return TRUE;
}
if you want to change kick time search for 900000 and change it for something else.
have fun.
Attachments
You must be registered for see attachments list