Ulysses Stuff > Ulysses Release Archives

AAFK V_3.1 : Anti-AFK system for Garry's Mod

<< < (2/25) > >>

Megiddo:
@Mr. P, choose verbs wisely when using fancy logging. :)

I suggest "<Name> went AFK" which works with "You went AFK" and "Bob went AFK".

MrPresident:
Yes.. the verb.. I caught it right away but I thought it was comical and I figured it would only affect the person who was going afk.. (but I'll change it)

Also, it prints twice because the first is the FancyLog. Which will only display if you have logecho on. The second is the notification I added to show to all connected players when a player goes in and out of afk. If you want to disable the second one, look in the code for anywhere you see ulib.tsayColor and comment it out.

V3.1
------
+Fixed the verbage to make more sense.

Download in the original post.

Eccid:
I've run into only one issue with this. TTT has an auto spectate option, if that activates after you go into afk, the afk resets. Is it possible to make it so if TTT puts you into spectate that counts as you going afk, then it skips to step two for waiting to be kicked? Or at least could you point me in the direction on how to implement this on my own, since you guys try to keep ulx independent from game modes.

MrPresident:
Find out how to tell if the player is in the spectate option for TTT. Once you have that.. You'll need to modify the 3 functions that check if the player has done something to break the afk.

All 3 functions have the same code, i just had them separated for debugging purposes, I might merge them in the future. For now just change the code to this: (this is pseudo-code.. you'll have to actually figure out what the TTT spectate code is)



--- Code: --- function ulx.AFKExit_Chat( pl )
if pl.afk == false then return end
if pl:IsTTTSpectator() then return end

if not IsValid( pl ) then return end
if not pl:IsConnected() then return end
ulx.ResetAFKStatus( pl )
end
hook.Add("PlayerSay", "AFKExit_Chat", ulx.AFKExit_Chat)

--- End code ---


On a totally unrelated note... I just noticed I hit over 1000 posts.. woo!

SuperAero_:

--- Quote from: MrPresident on January 14, 2013, 11:28:55 PM ---
On a totally unrelated note... I just noticed I hit over 1000 posts.. woo!

--- End quote ---

Grats :P

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version