SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/02/2012, 07:48 PM   #11
Babul
High-roller
 
Babul's Avatar
 
Join Date: Sep 2009
Location: in a cement block
Posts: 1,781
Reputation: 266
Default Re: Best way to detect if AFK

1 ) too much in that line
i think this code wont work. you are setting each Pos[] and OldPos[] in the same call. how about making the old positions global for each player, and only write into them? then they will always "lag" 1 frame behind the later, updated position. (with the "lag"/old position, you can subtract the new position. it will be equal if the player didnt move for 1 frame, atm its 0 frames. always true, or am i wrong?
Babul is offline   Reply With Quote
Old 04/02/2012, 07:49 PM   #12
[XST]O_x
High-roller
 
[XST]O_x's Avatar
 
Join Date: Aug 2009
Posts: 1,960
Reputation: 94
Default Re: Best way to detect if AFK

You have a double braclet.
pawn Code:
if(OldPos[0] == NewPos[0])
{
}
[XST]O_x is offline   Reply With Quote
Old 04/02/2012, 08:24 PM   #13
FireCat
High-roller
 
FireCat's Avatar
 
Join Date: Jul 2010
Posts: 2,322
Reputation: 609
Default Re: Best way to detect if AFK

pawn Code:
if(floatcmp(OldPos[0], NewPos[0]) == 0)
FireCat is offline   Reply With Quote
Old 05/02/2012, 11:53 AM   #14
shitbird
Gangsta
 
shitbird's Avatar
 
Join Date: Nov 2007
Posts: 719
Reputation: 31
Default Re: Best way to detect if AFK

Quote:
Originally Posted by jamesbond007 View Post
what if he hasnt moved -.-

once u stop moving u get kicked for AFK ? i think there is a better way..
That's the point.
If he didn't move, we're assuming he is not actually in the game, or he is simply afk.
shitbird is offline   Reply With Quote
Old 05/02/2012, 12:00 PM   #15
ғαιιοцт
High-roller
 
ғαιιοцт's Avatar
 
Join Date: Feb 2008
Posts: 1,428
Reputation: 188
Default Re: Best way to detect if AFK

Quote:
Originally Posted by shitbird View Post
That's the point.
If he didn't move, we're assuming he is not actually in the game, or he is simply afk.
But then you'll get kicked while typing something in the chat because you're not moving..

You should only kick them if they're not moving for 40 seconds or so
ғαιιοцт is offline   Reply With Quote
Old 06/02/2012, 08:18 AM   #16
shitbird
Gangsta
 
shitbird's Avatar
 
Join Date: Nov 2007
Posts: 719
Reputation: 31
Default Re: Best way to detect if AFK

Quote:
Originally Posted by ғαιιοцт View Post
But then you'll get kicked while typing something in the chat because you're not moving..
Obviously. That's why you give them more than 10 seconds.
shitbird is offline   Reply With Quote
Old 06/02/2012, 08:30 AM   #17
Cameltoe
High-roller
 
Cameltoe's Avatar
 
Join Date: Apr 2010
Location: Norway
Posts: 1,741
Reputation: 24
Default Re: Best way to detect if AFK

Or a confirmation that you are nor not AFK by sending the client an message once they are detected as AFK, and tell them to type no in chat or so.
__________________

Quote:
Originally Posted by Cameltoe View Post
Share the progress so others who are looking for the same also find's their answer.
Quote:
Originally Posted by teomakedonija View Post
ahaha i don't want
Rep++;
Cameltoe is offline   Reply With Quote
Old 06/02/2012, 08:32 AM   #18
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 1,988
Reputation: 133
Default Re: Best way to detect if AFK

Check this out.
http://forum.sa-mp.com/showthread.php?t=281590

I don't know tho if it's still working. Never touch them anymore.
__________________
(RETIRED)
=WoR=Varth is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
detect manchestera Scripting Help 1 21/10/2011 09:36 PM
Detect CJ Run? Antonio [G-RP] Help Archive 10 29/03/2011 08:53 AM
afk detect Amine_Mejrhirrou Help Archive 6 02/03/2011 12:24 PM
detect again willsuckformoney Help Archive 7 01/08/2010 07:27 AM
Detect radi Help Archive 5 19/07/2009 11:57 AM


All times are GMT. The time now is 05:08 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.