Raised This Month: $99 Target: $400
 24% 

[ANY]Warning system[UPDATED 2011-12-12]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
MindeLT
Senior Member
Join Date: Dec 2010
Location: Lithuania
Plugin ID:
2369
Plugin Version:
1.0b
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    3 
    Plugin Description:
    Advanced players warning system. Very helpful for warning and punishing players. Stores info to MySQL.
    Unapprover:
    Reason for Unapproving:
    Potential for SQL Injection, see #106 for more information.
    Old 06-04-2011 , 07:27   [ANY]Warning system[UPDATED 2011-12-12]
    Reply With Quote #1



    Requirements:
    MySQL database.
    Colors snippet
    SourceBans


    MySQL table(execute this in your database):
    PHP Code:
    CREATE TABLE user_warn (
      
    id int(10unsigned NOT NULL auto_increment,
      
    nick varchar(65NOT NULL,
      
    steam_id varchar(65NOT NULL,
      
    warn int(10NOT NULL,
      
    reason varchar(65NOT NULL,
      
    admin varchar(65NOT NULL,
      
    PRIMARY KEY (id)
    ); 
    Descripction:

    This plugin gives admin ability to warn player. After the player reaches warnings thereshold, he gets punished. There are two ways to punish player: KICK, or BAN. BAN time is currently changeable in .cfg. All the data is stored in MySQL(id, nick, steam_id, warn, admin, reason).

    Features:

    Admin can warn player easily, without saying him anything, or begging.
    Option to choose punishment.
    Option to choose max warning thereshold.
    Option to choose punishments reason.
    Option to choose ban lenght.
    Players can check their warnings by typing in chat !mywarn or /mywarn.

    v1.0alpha features:
    Option to punish player every warn.
    Option to enable warn sound.
    6 Different EVERY warn punishment options:
    1- Kick
    2- Freeze
    3- Slap
    4- Slay
    5- Freeze until agreement(player must read rules, before unfreeze)
    6- Ban
    Option to customize freeze time
    Option to customize slap damage
    Option to customize agreement word(chat triggered)
    Option to customize ban lenght
    Option to double ban time, each warn player gets.
    Warn system announcement.
    Adminmenu integration
    Reasons storage in MySQL
    Admin storage in MySQL
    SourceBans support
    Translanslations support





    Command Usage:

    sm_warn <nick> <reason>
    !mywarn or /mywarn - displays your warnings status.

    ConVars:
    warn_version : Plugin version

    warn_system "1" : Enables/disables Warning System plugin. Default: 1

    warn_ban_reason "[WARN] You've been bad boy. Take a rest" : Ban punishment reason. Default: "[WARN] You've been bad boy. Take a rest"

    warn_ban_time "60" : Ban punishment lenght in minutes. Default: 60 minutes.

    warn_kick_reason "[WARN] Slow down, Bieber" : Kick punishment reason. Default: "[WARN] Slow down, Bieber"

    warn_max "5" : Maximum warnings thereshold. Default: "5"

    warn_punishment "2" : Punishment. 1-Kick 2- Ban. Default: 2

    v1.0alpha ConVars:

    warn_punish_every "1" : Ability to punisher client every warn they get <1-enable, 2-disable>

    warn_punishment_sound "1" : Punishment sound for client, every warn. <1-enable, 2-disable>

    warn_every_warn_bantime "5" : How long to ban player every warn. Minutes.

    warn_every_warn_bantime_double "1" : Double bantime then getting more warns.

    warn_every_punishment "5" : Punishment for every warn client gets. <1-kick, 2-freeze, 3-slap, 4-slay, 5-chat agreement(with freeze) 6- ban>.

    warn_agreemen_word "sutinku" : Agreement word, which must be typed. Required: <warn_every_punishment 5>

    warn_freeze_time "5.0" : Warn freeze time. Required: <warn_every_punishment 2>

    warn_slap_damage "30" : Warn slap time. Required: <warn_every_punishment 3>"

    warn_announce "1" : Warning announcement."

    Languages supported:
    Lithuanian
    English

    Special thanks:

    Peace-Maker - you helped me a lot with those MySQL functions. Thanks
    EuroCSS.LT - inspires me to develop something new.

    Changes:
    v1.0alpha

    Option to punish player every warn.
    Option to enable warn sound.
    6 Different EVERY warn punishment options:
    1- Kick
    2- Freeze
    3- Slap
    4- Slay
    5- Freeze until agreement(player must read rules, before unfreeze)
    6- Ban
    Option to customize freeze time
    Option to customize slap damage
    Option to customize agreement word(chat triggered)
    Option to customize ban lenght
    Option to double ban time, each warn player gets.
    Warn system announcement.
    Adminmenu integration
    Reasons storage in MySQL
    Admin storage in MySQL
    SourceBans support
    Translanslations support

    v0.4a
    Replaced all the queries to SQL_TQueries(Thearded), and added Thearded connection, so it wont lag anymore(Thanks to Peace-Maker)
    Added ConsoleCmd for /mywarn
    Added Public notify cvar.
    Attached Files
    File Type: txt plugin.warn_system.txt (4.6 KB, 553 views)
    File Type: sp Get Plugin or Get Source (warn_sistema_v1.0b.sp - 509 views - 21.6 KB)
    File Type: smx warn_sistema_v1.0b.smx (16.7 KB, 412 views)

    Last edited by MindeLT; 12-14-2011 at 16:44. Reason: 1.0b release
    MindeLT is offline
    Send a message via Skype™ to MindeLT
    Schotti
    New Member
    Join Date: Feb 2011
    Old 06-04-2011 , 09:15   Re: [CS:S] Warning system
    Reply With Quote #2

    Nice Idea

    Can you add to the database see why someone would receive a warning? Or in /mywarn that there is a list, why somebody receive a warn?
    Schotti is offline
    Drixevel
    AlliedModders Donor
    Join Date: Sep 2009
    Location: Somewhere headbangin'
    Old 06-04-2011 , 10:18   Re: [CS:S] Warning system
    Reply With Quote #3

    Can this also work for TF2 as well? or L4D2? It seems like an interesting idea to keep people in check.
    __________________
    Discord: Drixevel#5049 - Steam Profile (Taking clients for commissions)
    Drixevel is offline
    Peace-Maker
    SourceMod Plugin Approver
    Join Date: Aug 2008
    Location: Germany
    Old 06-04-2011 , 11:15   Re: [CS:S] Warning system
    Reply With Quote #4

    Quote:
    Originally Posted by r3dw3r3w0lf View Post
    Can this also work for TF2 as well? or L4D2? It seems like an interesting idea to keep people in check.
    There is nothing mod dependent in there, so it should work on any mod.

    @MindeLT: Nice release! That was fast Some suggestions:
    You should only use SQL_TQuery's and store the database handle globally instead of opening a new connection every time and closing it. (You don't close it in your say hook btw.) Use SQL_TConnect as the wiki shows you.
    Especially the SELECT queries should be threaded, as they have to receive information back, which could lag your server.

    You need to add a public versioning convar (FCVAR_NOTIFY) to get this approved. You could register a 'sm_mywarn' console command instead of hooking the say command. Those commands are automatically chattriggers like /mywarn and !mywarn depending on the sourcemod settings.
    __________________
    Peace-Maker is offline
    MindeLT
    Senior Member
    Join Date: Dec 2010
    Location: Lithuania
    Old 06-04-2011 , 11:21   Re: [CS:S] Warning system
    Reply With Quote #5

    Quote:
    Can you add to the database see why someone would receive a warning? Or in /mywarn that there is a list, why somebody receive a warn?
    I'll have in mind, for future plans

    Quote:
    Can this also work for TF2 as well? or L4D2? It seems like an interesting idea to keep people in check.
    Tested only on CS:S, but there isnt any specific functions only for CS:S in this script, so i think, it should do well in TF2 and L4D2 too.

    @Peace-Maker

    Thanks for advises! I'll fix those soon

    Last edited by MindeLT; 06-04-2011 at 11:24.
    MindeLT is offline
    Send a message via Skype™ to MindeLT
    sinblaster
    Grim Reaper
    Join Date: Feb 2010
    Location: Australia
    Old 06-04-2011 , 18:22   Re: [CS:S] Warning system
    Reply With Quote #6

    nice
    __________________
    Happy Happy Joy Joy

    sinblaster is offline
    angel635
    Senior Member
    Join Date: Apr 2011
    Old 06-05-2011 , 08:51   Re: [CS:S] Warning system
    Reply With Quote #7

    hello

    how to solve problem please?

    I join the log of error
    Attached Files
    File Type: log errors_20110605.log (624 Bytes, 269 views)
    angel635 is offline
    Psykotrop
    New Member
    Join Date: Jan 2011
    Old 06-05-2011 , 10:52   Re: [CS:S] Warning system
    Reply With Quote #8

    Quote:
    Originally Posted by Peace-Maker View Post
    @MindeLT: Nice release! That was fast Some suggestions:
    You should only use SQL_TQuery's and store the database handle globally instead of opening a new connection every time and closing it. (You don't close it in your say hook btw.) Use SQL_TConnect as the wiki shows you.
    Especially the SELECT queries should be threaded, as they have to receive information back, which could lag your server.
    In fact I put this plugin on my server with 38 people on it and every time I warn someone the server timeout 2 seconds.

    But nice idea, good luck ;)
    Psykotrop is offline
    MindeLT
    Senior Member
    Join Date: Dec 2010
    Location: Lithuania
    Old 06-06-2011 , 17:20   Re: [CS:S] Warning system
    Reply With Quote #9

    I'll fix this, adding only thearded queries, as Peace-Maker sayed, so it wont be any timeout. At the moment, i'm having problems with my Dedicated Server(optimizing Kernel), so don't really have time to fix it

    @Angel635:

    add mysql connection to database.cfg

    Plugin uses default database setup.
    MindeLT is offline
    Send a message via Skype™ to MindeLT
    lokizito
    Veteran Member
    Join Date: Dec 2010
    Location: Brazil
    Old 06-06-2011 , 21:49   Re: [CS:S] Warning system
    Reply With Quote #10

    You should add SQLite support. Basically, just look was is configured and change between :
    PHP Code:
    db SQL_Connect("default"trueerrorsizeof(error)); 
    and
    PHP Code:
    db SQLite_UseDatabase("yourdbhere",error,sizeof(error)); 
    __________________
    [CS:S] RankMe - Why pay for a rank plugin if you can have one for free?
    [CS:S] RankMe Connect Announcer - Announce when a player connect
    Translation Project - Let's make the plugins to be international
    lokizito is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 12:22.


    Powered by vBulletin®
    Copyright ©2000 - 2020, vBulletin Solutions, Inc.
    Theme made by Freecode