AFK Detection
#1

Hello, I am planning on making an AFK detector for my server but I have no idea how I would start it off, if someone wouldn't mind telling me how to it'd be much appreciated.

Thanks!
Reply
#2

http://forum.sa-mp.com/showthread.ph...=onplayerpause
Reply
#3

Floats, Playerupdates, timers.
Reply
#4

Hmm, could you possibly give me a little example please?
Reply
#5

PHP код:
enum iFloat
{
    
Float:PosX,
    
Float:PosY,
    
Float:PosZ,
    
Float:Angle,
    
Float:Healthbar,
    
Float:Armourbar,

You can aswell add a new variable such as
PHP код:
new CheckPlayerAFK[MAX_PLAYERS];
new 
UpdateInfo[MAX_PLAYERS][iFloat];
new 
InactivePlayer[MAX_PLAYERS]; 
PHP код:
public OnPlayerConnect(playerid)
{
    
UpdateInfo[playerid][PosX] = 0;
    
UpdateInfo[playerid][PosY] = 0;
    
UpdateInfo[playerid][PosZ] = 0;
    
UpdateInfo[playerid][Angle] = 0;
    
UpdateInfo[playerid][Healthbar] = 0;
    
UpdateInfo[playerid][Armourbar] = 0;
    
InactivePlayer[playerid] = 0;
    
CheckPlayerAFK[playerid] = 0;
    return 
1;

Note, you will need stocks.


Edit: there's many more stuff you can use, I just gave ya an example
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)