Raised This Month: $ Target: $400
 0% 

Problem with AFK Detection


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2020 , 21:38   Re: Problem with AFK Detection
Reply With Quote #9

Do some debugging. This involves adding logs/server_prints() in places in your code to help determine why conditions/values are not what you expect.
PHP Code:
public DeathMsg()
{   
    new 
iKiller read_data);
    new 
iVictim read_data);
    if(
g_bMapBanned || !is_user_connected(iVictim) || !is_user_connected(iKiller))
        return 
PLUGIN_HANDLED

    log_amx
"Checking if player %d is AFK= %d" iVictim g_pdAFKDataiVictim ][ IsAFK ] ? "true" "false" );
    if(!
g_pdAFKDataiVictim ][ IsAFK ])
    {
        
pdData[iKiller][Kills]++;
    }
    else
    {
        
ChatColor(iKiller"!g* !yPlayer !g%s is!teamAFK !ykill doesn't count!")
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_HANDLED

__________________
Bugsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode