AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [ANY]Warning system[UPDATED 2011-12-12] (https://forums.alliedmods.net/showthread.php?t=158407)

MindeLT 06-04-2011 07:27

[ANY]Warning system[UPDATED 2011-12-12]
 
3 Attachment(s)

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

http://www.eurocss.lt/images/warn_image.jpg

http://www.eurocss.lt/images/warn_image2.jpg

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.

Schotti 06-04-2011 09:15

Re: [CS:S] Warning system
 
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?

Drixevel 06-04-2011 10:18

Re: [CS:S] Warning system
 
Can this also work for TF2 as well? or L4D2? It seems like an interesting idea to keep people in check. :3

Peace-Maker 06-04-2011 11:15

Re: [CS:S] Warning system
 
Quote:

Originally Posted by r3dw3r3w0lf (Post 1481122)
Can this also work for TF2 as well? or L4D2? It seems like an interesting idea to keep people in check. :3

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.

MindeLT 06-04-2011 11:21

Re: [CS:S] Warning system
 
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 :)

sinblaster 06-04-2011 18:22

Re: [CS:S] Warning system
 
nice

angel635 06-05-2011 08:51

Re: [CS:S] Warning system
 
1 Attachment(s)
hello

how to solve problem please?

I join the log of error

Psykotrop 06-05-2011 10:52

Re: [CS:S] Warning system
 
Quote:

Originally Posted by Peace-Maker (Post 1481138)
@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 ;)

MindeLT 06-06-2011 17:20

Re: [CS:S] Warning system
 
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.

lokizito 06-06-2011 21:49

Re: [CS:S] Warning system
 
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)); 



All times are GMT -4. The time now is 04:35.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.