ULX

Author Topic: AWarn 3.4 - Robust warning system  (Read 138681 times)

0 Members and 1 Guest are viewing this topic.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: AWarn 3.3 - Robust warning system
« Reply #45 on: February 28, 2013, 09:26:11 PM »
Hmm, I will have to test this when I'm fully recovered. I do all of my testing on a local listen server. I recently set up a dedi server in my room and I will start using that for final release testing.

Offline delagious

  • Newbie
  • *
  • Posts: 21
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #46 on: March 01, 2013, 09:32:36 PM »
You know you're supposed to be typing those on the server console or rcon, right?
Are you?
Yeah, MrPresident pointed that out to me earlier and that fixed my first issue of it not working because I was doing it wrong.
I am using server console and getting that error message but the commands still work.

Offline xXBryanXx

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #47 on: March 28, 2013, 03:30:51 PM »
Is there any possible way of making it like 3 warns=kick 7 warns=ban 10=permaban or something along those lines?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: AWarn 3.3 - Robust warning system
« Reply #48 on: March 28, 2013, 07:16:48 PM »
No, but you could find compromise and use temp ban instead of kick, then permaban.
Seriously, though the code could be written to do so, if someone requires that many warnings, I don't want them on ANY server I'm playing on, and would most likely leave before they got banned.

Configurations (Note: these are server console variables. Run these from the server console)

ulx_warnkick_num [number] - this console variable will set the number of active warnings a player should be allowed to receive before being kicked.
ulx_warnkick_decayrate [number] - this console variable will set the amount of time (in minutes) before a player's warnings are reduced by 1. (note: a player must be connected for their warnings to decay)
ulx_warnkick_ban [number] - Determines if the script should tempban instead of kicking. (1 - On, 0 - Off) (Default: 0)
ulx_warnkick_bantime [number] - Time (in minutes) the script will ban players who have exceeded their threshold for warnings. (Default: 30)

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • Terror Abound! Steam Group
Re: AWarn 3.3 - Robust warning system
« Reply #49 on: March 30, 2013, 06:45:43 PM »
I don't think that the decayrate works. I have it set to decay after 4 hours, and no warnings are decaying. any suggestions?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: AWarn 3.3 - Robust warning system
« Reply #50 on: March 30, 2013, 08:12:54 PM »
I don't think that the decayrate works. I have it set to decay after 4 hours, and no warnings are decaying. any suggestions?

Decayrate only decays while a person is connected.
A person could connect 4 days for one hour each before the decay would stop.
Are you sure you're counting only their connection time?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • Terror Abound! Steam Group
Re: AWarn 3.3 - Robust warning system
« Reply #51 on: March 31, 2013, 01:19:08 PM »
I had a user that hadn't received a warning in over a month and is very active on my server, and he recently got warning banned for a third warning because the other hadn't decayed. It seems to happen with everyone as well.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: AWarn 3.3 - Robust warning system
« Reply #52 on: April 08, 2013, 02:36:21 PM »
If I recall correctly, the decay rate is a timer not in conjunction to the players play time. For example, the server decay timer is set to every 4 hours. If a player with active warnings joins 3 hours after the server starts he will receive a reduction of 1 warning after only 1 hour. It's not the most effective way to manage warnings, but it was the only solution I could come up with at the time. I will look onto making this more effective when I am out of the hospital.

So, for your players to lose a warning they may need to stay connected for up to 4 hours in a single session, as it does not roll over.

Offline Duke Nukem

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #53 on: April 09, 2013, 09:09:38 AM »
Invalid strings VnV whut do?

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • Terror Abound! Steam Group
Re: AWarn 3.3 - Robust warning system
« Reply #54 on: April 09, 2013, 01:34:48 PM »
If I recall correctly, the decay rate is a timer not in conjunction to the players play time. For example, the server decay timer is set to every 4 hours. If a player with active warnings joins 3 hours after the server starts he will receive a reduction of 1 warning after only 1 hour. It's not the most effective way to manage warnings, but it was the only solution I could come up with at the time. I will look onto making this more effective when I am out of the hospital.

So, for your players to lose a warning they may need to stay connected for up to 4 hours in a single session, as it does not roll over.

I'll just drop the time length for now, thanks for helping. Hope you get better soon.

Offline Duke Nukem

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #55 on: April 12, 2013, 08:21:48 AM »
MrPresident, when I try to warn someone, I get an "invalid strings" error, I'll edit it into the post later.

Offline krackalackin

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #56 on: April 18, 2013, 12:37:02 AM »
This mod would be perfect with a user available report system.

Offline nathan736

  • Full Member
  • ***
  • Posts: 143
  • Karma: 4
Re: AWarn 3.3 - Robust warning system
« Reply #57 on: April 18, 2013, 08:48:50 AM »
Code: [Select]
--[[
        ulx.DecayWarnings()
       
        This function runs on a timer and removes 1 active warning from a players warning count. The player needs to be playing on the server
        when this is called to have a warning removed.
]]
 
function ulx.DecayWarnings()
        print("Decay timer running")
 
        for _, pl in pairs ( player.GetAll() ) do
        if pl.timewarned == 0 then pl.timewarned = 1 end -- prevents the line bellow from being 0 ever
            if pl:TimeConnected( ) <= GetConVarNumber( "ulx_warnkick_decayrate" ) * 60 * pl.timewarned then continue end
                if pl.warntable == nil then continue end
                if pl.warntable["wcount"] == nil then continue end
                if pl.warntable["wcount"] <= 0 then continue end
               
                pl.warntable["wcount"] = pl.warntable["wcount"] - 1
                ulx.WarningSave( pl )
        pl.timewarned = pl.timewarned + 1
                ULib.tsayColor(pl, Color(0,0,0,255), "AWarn: " , Color(255,255,255,255), "Your total warning count has been reduced by ", Color(255,0,0,255), "1")
       
        end
        timer.Create( "ULX_DecayTimer", 60, 1, ulx.DecayWarnings )
        --timer.Create( "ULX_DecayTimer", GetConVarNumber( "ulx_warnkick_decayrate" ) * 60, 1, ulx.DecayWarnings ) -- keeping as a backup
end
timer.Create( "ULX_DecayTimer", 1, 1, ulx.DecayWarnings )
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index85a1.html
martus link for player time connected
http://ideone.com/WqnGdD
link for full code
i modifyed the decay timer code to update and check if the players connected time was higher then the time you set multiplied by the times he has already been decayed during that connection (because changing the code to player connect time required this) this should solve the derpy decay code that was there assuming i did not break anything :D
« Last Edit: April 18, 2013, 08:54:03 AM by nathan736 »
a person asked me how to code lua and i said this " its like building a rocket up side down then  realizing you did it all wrong."

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: AWarn 3.3 - Robust warning system
« Reply #58 on: April 19, 2013, 07:27:16 AM »
The code you suggest would remove 1 warning from the player every 60 seconds assuming they'd been connected longer than the decay rate. This gives me an idea though.

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • Terror Abound! Steam Group
Re: AWarn 3.3 - Robust warning system
« Reply #59 on: May 09, 2013, 03:02:42 PM »
Yeah, warnings aren't decaying at all on my server. I know you've got stuff going on so it's no rush. Just reporting it.