STEAM GROUP
SourceBans sourcebans
STEAM GROUP
SourceBans sourcebans
53
IN-GAME
293
ONLINE
Founded
6 August, 2007
Language
English
Werewolf™ 5 Mar, 2017 @ 11:42am
Automatic upgrade to permanent ban after X number of previous bans
I originally asked this on AlliedModders, but didn't get the answer I needed. (Original thread here - https://forums.alliedmods.net/showthread.php?t=291573)

What I would like to do is set it so when a player reaches a certain number of bans, their ban is automatically upgraded to a permanent ban.

So for example, on my servers we have a rule that your 6th ban is permanent, regardless of the reason. That means the first 5 aren't permanent (unless they are hacking), but ban number 6 always will be permanent.

On the original thread, I was told "you can do this yourself with a mysql query" but when I asked how to do that I got no response.

So could someone explain how to do this?
< >
Showing 1-2 of 2 comments
Werewolf™ 8 Mar, 2017 @ 4:30pm 
Finally got this working thanks to u/GeneralGrenade over on r/PHPhelp

Solution was to create a trigger with the following:
IF (SELECT COUNT(bid) FROM `sb_bans` WHERE authid = NEW.authid) > 4 THEN SET NEW.length = 0; SET NEW.reason = CONCAT(NEW.reason, ' - 6th ban so permanent'); END IF
That's very cool! Thanks for sharing!!!!
< >
Showing 1-2 of 2 comments
Per page: 1530 50