Recent Posts

Pages: [1] 2 3 ... 10
Make yourself an admin, then post the output from "ulx debuginfo".
Releases / AAFK 4 - Anti-AFK Plugin for Garry's Mod
« Last post by MrPresident on Yesterday at 02:42:36 PM »
Anti-AFK Version 4.0

This script monitors a players movements and actions on a server to attempt to determine if they are AFK. If they are found to be AFK it will tag them as such (client-side graphical).
Optionally (enabled by default) you can have the script kick players who have been afk for a certain number of minutes.

Installation Instructions:
Subscribe to the addon on the Steam Workshop. Once you've started your server, you can modify the default settings through your server console. See ConVars below.

Console Variables:
aafk_enabled - ( Default: 1 ) - Is AAFK enabled? (0 - No, 1 - Yes)
aafk_flagminutes - ( Default: 5 ) - How long (in minutes) the player needs to be away before being flagged as AFK
aafk_kickminutes - ( Default: 10 ) - How long (in minutes) the player needs to be away before being kicked (if kicking is enabled).
aafk_ignoreadmins - ( Default: 0 ) - Should AAFK ignore admins? (0 - No, 1 - Yes)
aafk_kickenabled - ( Default: 1 ) - Should AAFK kick players who have remained AFK? (0 - No, 1 - Yes)
aafk_kickonlywhenfull - ( Default: 0 ) - If kicking is enabled, should AAFK only kick players when the server is full? (0 - No, 1 - Yes)
aafk_displayafkinchat - ( Default: 1 ) - Should it be announced to chat when a player goes AFK or returns from AFK? (0 - No, 1 - Yes)

Further Configuration:
If you are running ULX, you can give players or groups the ability to be ignored by the system. This also requires for aafk_ignoreadmins to be set to 1.

ulx groupallow [group] aafk_immunity
ulx userallow [user] aafk_immunity

Questions or Comments? Please comment!
Releases / Re: UccTV -- Watch all your players at once
« Last post by Flinta on Yesterday at 02:20:05 PM »
Freaky. but i like it :P now make it work at home.
Developers Corner / Re: I need a bit of help with a Custom Auto-Hop command
« Last post by Kowalski on February 12, 2018, 06:21:04 PM »
Alright thanks! I might see if I can find a button that isn't used by default and isn't annoying to reach for to use the bunny-hop, some people don't like bunny-hopping while always crouched.\
Many thanks for the help and comments, hopefully I'll be able to work on some more stuff!
Developers Corner / Re: I need a bit of help with a Custom Auto-Hop command
« Last post by iViscosity on February 12, 2018, 05:51:44 PM »
Be sure that when you say something "does not work", you say both it's intended response (even if your question implies it) and what the expected response is (again, even if it's implied). Also be sure to say any errors you may be getting.

There's one thing with it, when you use this command on someone it will only do anything if, at that moment, they are holding down their jump key and are on the ground. You'd need something that does this at any time. (Also you have a param of "ULib.cmds.PlayerArg" when your code suggests that it should be "ULib.cmds.PlayersArg" (due to the #target_ply))

Another thing is that clientside logic takes precedence over serverside logic. For example, you telling the client to +jump can be overridden by a client's +jump. Also even if they jump, your -jump immediately just makes them stop. Overall, your code does nothing but makes the person jump.

Code: Lua
  1. function ulx.bhop( calling_ply, target_ply, should_bhop )
  2.     target_ply:SetNWBool( "bhop", should_bhop ) -- A networked bool allows you to access values on a specific player.
  3.     ulx.fancyLogAdmin( calling_ply, "#A enabled Sick-Hops on #T", target_ply ) -- You have the "amount" in your fancyLogAdmin(), which is not necessary.
  4. end
  5. local bhop = ulx.command( "Fun", "ulx bhop", ulx.bhop, "!bhop" )
  6. bhop:addParam{ type = ULib.cmds.PlayerArg }
  7. bhop:addParam{ type = ULib.cmds.BoolArg, invisible = true }
  8. bhop:defaultAccess( ULib.ACCESS_ALL ) -- I don't recommend this because this allows anyone to target anyone else (that their inheritance lets them)
  9. bhop:setOpposite( "ulx unbhop", { _, _, false }, "!unbhop" )
  10. bhop:help( "Enables Auto Hop on the target" )

And now you need something on the client to edit how a player moves. The best way to do this is by using GM:CreateMove. Now I'd recommend making the bhop key something that isn't their IN_JUMP key. This is because of what I said earlier: their logic will override CreateMove's logic, even if it's clientside. According to the CreateMove wiki:
Code: [Select]
Due to this hook being clientside only, it could be overridden by the user allowing them to completely skip your logic, it is recommended to use GM:StartCommand in a shared file instead.
Now, if you use something that isn't IN_JUMP, you don't have to worry about this.
For example:
Code: Lua
  1. if ( CLIENT ) then -- Put this in the same file as ulx.bhop() so you can do this
  2.     hook.Add( "CreateMove", "bhop", function( ucmd )
  3.         local ply = LocalPlayer() -- Just easier.
  4.         if ply:GetNWBool( "bhop" ) and ply:GetNWBool( "bhop" ) == true --[[ not necessary, but for more readability ]] and IsValid( ply ) and ucmd:GetButtons(), IN_DUCK ) > 0 then -- performs bitwise "and" on GetButtons() and IN_DUCK (so basically, checks if IN_DUCK (their duck) is being performed).
  5.             if ply:OnGround() then -- If they're not on the ground, don't do anything
  6.                 ucmd:SetButtons( bit.bor( ucmd:GetButtons(), IN_JUMP ) ) -- Performs bitwise "or" on GetButtons() and IN_JUMP. Basically, sets their status to either crouch (IN_DUCK) or jump (IN_JUMP).
  7.             end
  8.         end
  9.     end )
  10. end

Sorry I kinda wrote it for you, I tried to comment it so you'd understand what it was, but that should work (it's actually taken from a separate addon I wrote that had this exact thing in it). Basically, you need something that is globally accessible, and actually does something after it ends the jump.
Developers Corner / I need a bit of help with a Custom Auto-Hop command
« Last post by Kowalski on February 12, 2018, 04:54:48 PM »
I've been trying to find any sort of a bunny hop command for ULX, but to no avail, so I thought I could make my own, I attempted to do it with this code:
Code: Lua
  1. function ulx.bhop( calling_ply, target_ply, amount)
  2.         for i=1, #target_ply do
  3.                 if target_ply():IsOnGround() and target_ply:KeyDown( IN_JUMP ) then
  4.                         target_ply:SendLua([[RunConsoleCommand("+jump")]])
  5.                         timer.simple(0.2, function() target_ply:SendLua([[RunConsoleCommand("-jump")]]) end)
  6.                 end
  7.         end
  8.         ulx.fancyLogAdmin( calling_ply, "#A enabled Sick-Hops on #T", target_ply, amount )
  9. end
  10. local bhop = ulx.command( "Fun", "ulx bhop", ulx.bhop, "!bhop" )
  11. bhop:addParam{ type=ULib.cmds.PlayerArg }
  12. bhop:addParam{ type=ULib.cmds.NumArg, min=0, max=1, hint="1 is on, 0 is off", ULib.cmds.round }
  13. bhop:defaultAccess( ULib.ACCESS_ALL )
  14. bhop:help( "Enables Auto Hop on the target." )
I referenced the "ulx.hp" or the HP command to get some sort of guide on how to find a player target and on setting a value(0, 255).
I'd like to only work if the player is holding their jump button as well.
This does not work sadly, I was wondering if I could get some assistance and possibly some pointers on what I did wrong?

I see someone else is also requesting the same thing, a fix on there could also help me just as well.
- what could affect that?
- i've modified SV.db file

You've answered your question. Sounds like you corrupted the file.
Likely not noticed until certain players joined.

The only time I've ever seen player times lost is when the sv.db was damaged, erased, server reinstalled fresh (which writes new sv.db), etc.
Really, we can't know for sure, but, it's corrupt now. I'd recommend restore from backup.
Releases / Re: Player Connect/Disconnect Message [1.11v]
« Last post by JamminR on February 09, 2018, 03:35:48 PM »
1) First - why? Do you not trust your admin level staff? Admin in Gmod carries lots of access. If you're worried about admins seeing IP addresses of players that, as an admin, most people expect to help maintain a server, you aren't seeing a forrest surrounding the tree you are looking at.

1) Basic Gmod lua programming - we strongly encourage people to learn it here.
Really, this one is a fun one to learn from. Learning this one Gmod lua player function check might help you fix other items you've always wanted superadmin only (but, really, seriously, think about my #1 first)
Two files. I found one line logic statement with my experienced eyes in 10 seconds.
( Hint - Where, v or other variable letter is almost always the player being checked, if v:IsAdmin() then ... )
You can have little programming knowledge at all and likely have figured out where to edit, perhaps not HOW to edit (Hint, Player:IsSuperAdmin), but definitely where to edit.
Well, only a few players lost their time and i've modified SV.db file, but it was almost 2 weeks ago and everything was fine. I didn't even touch utime data, what could affect that?
Pages: [1] 2 3 ... 10