Wortel Angels Posted February 12, 2013 Author Share Posted February 12, 2013 ```If Player(Index).Moving = 0 And Player(Index).AFK = 0 Then If Player(Index).AFKTimer + 30000 <= GetTickCount Then If Player(Index).Sitting = 1 Then SendAFK SendSitting Else SendAFK End If Player(Index).AFKTimer = GetTickCount End IfElseIf Player(Index).Moving = 1 And Player(Index).AFK = 1 Then SendAFKEnd If```Thats my AFK SystemIt should work like:If youre not walking and not afk already-> Counter 30 Seconds–> Set you afkIf youre walking and afk then-> Set you back to not AFKThe Problem:If 2 players are on the map and one is moving around then is the second resetting his AFK statusSame for if 2 are afk and one start moving again -> Afk = 0 on both(Ignore the sitting stuff thats working)Fixed--Needed to move the setting afk stuff to the client loop Link to comment Share on other sites More sharing options...
abhi2011 Posted February 13, 2013 Share Posted February 13, 2013 ```If Player(Index).AFK = 0 And Player(Index).Moving = 0 Then If Player(Index).AFKTimer + 30000 <= GetTickCount Then If Player(Index).Sitting = 1 Then SendSitting End If SendAFK Player(Index).AFKTimer = GetTickCount End IfElseIf Player(Index).Moving = 1 And Player(Index).AFK = 1 Then SendAFKEnd If```I revamped the code a bit. Btw use the timer and AFK in tempplayerrecAnd about the SendAFK and SendSitting I am assuming it is sent to the map. And the client appropriately does the stuff. Make sure the client is setting the AFK status of the required player that is only the player that is AFK off and not the player with index of (myindex) Link to comment Share on other sites More sharing options...
Wortel Angels Posted February 13, 2013 Author Share Posted February 13, 2013 Fixed Thanks to Abhi with the skype help :-) Link to comment Share on other sites More sharing options...
Elihu Posted February 13, 2013 Share Posted February 13, 2013 Nice system. It seems that everyone is fine with the basic AFK procedure in games….."AFK guys!" "Brb" "Be right back!" and so on but that is really untrustworthy. Link to comment Share on other sites More sharing options...
Wortel Angels Posted February 13, 2013 Author Share Posted February 13, 2013 i just builded it that you dont stand infront of one and talk 1 hour to him till you realise hes afk xD Link to comment Share on other sites More sharing options...
boyesjs03 Posted February 13, 2013 Share Posted February 13, 2013 Sweet :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now