Raised This Month: $ Target: $400
 0% 

Problem with AFK Detection


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 05-25-2020 , 08:43   Re: Problem with AFK Detection
Reply With Quote #6

I've tried your way, but it don't work. This should check if is player AFK after 15 second from spawn.
The code:
Code:
new bool:g_IsAFK[33] public fwSpawn(id) {     if(!is_user_alive(id))         return HAM_IGNORED         if(is_user_alive(id))     {         pev(id, pev_origin, g_arrayOrigin[id]);                 remove_task(id+54784);         set_task(15.0, "Task_CheckAFK", id+54784);     }         return HAM_IGNORED } public Task_CheckAFK(id) {     id -= 54784;     if(is_user_alive(id))     {         new Float:flOrigin[3];         pev(id, pev_origin, flOrigin);                 if(g_arrayOrigin[id][0] == flOrigin[0] && g_arrayOrigin[id][1] == flOrigin[1] && g_arrayOrigin[id][2] == flOrigin[2])         {             g_IsAFK[id] = true         }         else         {             g_IsAFK[id] = false         }     } }

Registered events:
Code:
RegisterHam(Ham_Spawn,"player","fwSpawn",1)
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 05-25-2020 at 08:45.
Shadows Adi 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