Warning tool

A Config Script for Counter-Strike: Source

Yo, buddy. We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending im_the_new_guy points.
  • Post: Give im_the_new_guy your thoughts on this Script.
  • Vote: Help im_the_new_guy win the Monthly Awards.
  • Rate: Give this Script a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Script.
  • Watch: Get notified when this Script is updated.
Mascot

Sound fun?

Sign up

Already a Bananite? Login

An administration tool to help admins keep track of players behaving badly.

204 lines | 8 kb | Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<pre>block load
{
        // Edit the variable in 5 lines below.
        es_xsetinfo temp_ban_time 5 // EDIT ME: The amount of time the player is banned for.
        es_xsetinfo temp_ban_amount 5 // EDIT ME: The amount of warnings a player receives before a temp ban.
        es_xsetinfo perm_ban_time 100 // EDIT ME: The amount of time the player is banned for [0 = permenant]
        es_xsetinfo perm_ban_amount 10 // EDIT ME: The amount of warnings a player received before a perm ban.
        es_xsetinfo warning_admins "STEAM_0:1:14214794" // EDIT ME: Add your admins steam ID's here. Space them out like this: "STEAM:X:X:XXXXXXX ; STEAM:X:X:XXXXXXXXX ; STEAMX:X:XXXXXXXX"
        // Do not Edit Below Here.
        es_keygroupload warning |warning
        es_makepublic "Warning - created by I'm the new guy, go easy @ Hideexec.net"
        es_xmsg #multi #green[#lightgreenWarned#green]#default Loaded!
        es_xset playerlist_player 0
        es_xset playerlist_name 0
        es_xset playerlist_page 0
        es_xset playerlist_insline 0
        es_xset playerlist_chosen_player 0
        es_xset playerlist_new 0
        es_regsaycmd !warning "warning/warning_admin_check" description
}

block unload
{
        es_xset playerlist 0
        popup exists playerlist1 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist1
        popup exists playerlist2 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist2
        popup exists playerlist3 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist3
        popup exists playerlist4 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist4
        popup exists playerlist5 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist5
        popup exists playerlist6 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist6
        popup exists playerlist7 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist7
        popup exists playerlist8 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist8
        popup exists playerlist9 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist9
        popup exists playerlist10 playerlist
        if (server_var(playerlist) = 1) then popup delete playerlist10
       
        es_keygroupsave Warning |Warning
        es_keygroupdelete Warning
        es_unregsaycmd !warning
        es_xmsg #multi #green[#lightgreenWarned#green]#default Saved and Unloaded!
}

event es_map_start
{
        es_keygroupsave Warning |Warning
}

event player_activate
{
        es_xset group_exists 0
        es_exists group_exists keygroup Warning
        if (server_var(group_exists) == 0) do
        {
                es_keygroupcreate Warning
        }
        es_xset exists 0
        es_exists exists key Warning event_var(es_steamid)
        if (server_var(exists) == 0) do
        {
                es_keycreate Warning event_var(es_steamid)
                es_keysetvalue Warning event_var(es_steamid) warnings 0
        }
        es_keysetvalue Warning event_var(es_steamid) name event_var(es_username)
}

event round_start
{
        es_delayed 5 es_xmsg #multi #greenThis server is running the #lightgreenWarning #greenmod. This mod was created by #lightgreenI'm the new guy, go easy :D
        es_delayed 15 es_xmsg #multi #greenTo download the #lightgreenWarning #greenmod go to #lightgreenwww.hideExec.net#green.
}

event player_changename
{
        es_xset exists 0
        es_exists exists key Warning event_var(es_steamid)
        if (server_var(exists) == 1) do
        {
                es_keysetvalue Warning event_var(es_steamid) name event_var(newname)
        }
}

block warning_admin_check
{
        es_xset admin_check_id 0
        es_getcmduserid admin_check_id
        es_xset admin_check_steam_id 0
        es_getplayersteamid admin_check_steam_id server_var(admin_check_id)
        if (server_var(admin_check_steam_id) in server_var(warning_admins)) do
        {
                es_xset menu_name "Warning Menu"
                es_xset menu_players #all
                es_xset menu_block warning/warning_add
                es_xdoblock warning/playerlist
        }
        else do
        {
                es_tell event_var(userid) #multi #greenYou are not authorised to run the command #lightgreen!Warn#green.
        }
}


block warning_add
{
        es_xset warned_steamid 0
        es_getplayersteamid warned_steamid server_var(playerlist_chosen_player)
        es_xset warned_name 0
        es_getplayername warned_name server_var(playerlist_chosen_player)
        es_set current_warnings 0
        es_set current_name 0
        es keymath warning server_var(warned_steamid) warnings + 1
        es_keygetvalue current_warnings warning server_var(warned_steamid) warnings
        if (server_var(current_warnings) == server_var(temp_ban_amount)) do
        {
                banid server_var(temp_ban_time) server_var(warned_steamid) kick Banned for: Being warned to many times!
                es_msg #multi #green[#lightgreenWarned#green]#default The player:#lightgreen server_var(warned_name) #defaultwas banned for#lightgreen server_var(temp_ban_time) min.
                es_msg #multi #green[#lightgreenWarned#green]#default This player currently has#lightgreen server_var(current_warnings) #defaultwarnings.
        }
        if (server_var(current_warnings) == server_var(perm_ban_amount)) do
        {
                if (server_var(perm_ban_time) == 0) do
                {
                        banid 0 server_var(warned_steamid) kick Banned for: Being warned to many times!
                        es_msg #multi #green[#lightgreenWarned#green]#default The player:#lightgreen server_var(warned_name) default was banned#lightgreen Permenantly.
                        es_msg #multi #green[#lightgreenWarned#green]#default This player currently has#lightgreen server_var(current_warnings) #defaultwarnings.
                        es_keysetvalue warning server_var(warned_steamid) warnings 0
                }
                else do
                {
                        banid server_var(perm_ban_time) server_var(warned_steamid) kick Banned for: Being warned to many times!
                        es_msg #multi #green[#lightgreenWarned#green]#default The player:#lightgreen server_var(warned_name) default was banned for#lightgreen server_var(perm_ban_time) min.
                        es_msg #multi #green[#lightgreenWarned#green]#default This player currently has#lightgreen server_var(current_warnings) #defaultwarnings.
                        es_keysetvalue warning server_var(warned_steamid) warnings 0
                }
        }
        else do
        {
                es_msg #multi #green[#lightgreenWarned#green]#default The player:#lightgreen server_var(warned_name) #defaultnow has server_var(current_warnings) #defaultwarnings.
        }
}

block playerlist
{
        es_xdoblock warning/prepare_playerlist
        //es_cexec server_var(admin_check_id) play npc/overwatch/radiovoice/beginscanning10-0.wav
        es_tell server_var(admin_check_id) #green Loading Playerlist, Please Wait 1 Second.
        es_delayed 2 popup send playerlist1 server_var(admin_check_id)
        //popup send playerlist1 server_var(admin_check_id)
}

block prepare_playerlist
{
        es_xset player_numbering 0
        es_xset playerlist_number_insline 1
        es_xset menu_page 1
        popup create playerlist1
        es popup addline playerlist1 server_var(menu_name)
        popup addline playerlist1 "--------------------"
        popup addline playerlist1 "0. Exit"
        es foreach player playerlist_player server_var(menu_players) "es_xdoblock warning/create_playerlist"
}

block create_playerlist
{
        if (server_var(player_numbering) = 7) do
        {
                es_xset player_numbering 0
                es_xset playerlist_number_insline 1
                if (server_var(playerlist_page) = playerlist1) do
                {
                        es popup insline server_var(playerlist_page) 10 "9. More"
                }
                es_xelse do
                {
                        es popup insline server_var(playerlist_page) 11 "9. More"
                }
                es_xmath menu_page + 1
                es_format playerlist_new "playerlist%1" server_var(menu_page)
                es popup create server_var(playerlist_new)
                es popup submenu server_var(playerlist_page) 9 server_var(playerlist_new)
                es popup addline server_var(playerlist_new) server_var(menu_name)
                es popup addline server_var(playerlist_new) "--------------------"
                es popup addline server_var(playerlist_new) "8. Back"
                es popup submenu server_var(playerlist_new) 8 server_var(playerlist_page)
                es popup addline server_var(playerlist_new) "0. Exit"
        }
        es_xmath player_numbering + 1
        es_xmath playerlist_number_insline + 1
        es_format playerlist_page "playerlist%1" server_var(menu_page)
        es_getplayername playerlist_name server_var(playerlist_player)
        es_format playerlist_insline "->%1. %2" server_var(player_numbering) server_var(playerlist_name)
        es popup insline server_var(playerlist_page) server_var(playerlist_number_insline) server_var(playerlist_insline)
        es popup menuvalue server_var(playerlist_page) playerlist_chosen_player server_var(player_numbering) server_var(playerlist_player)
        es popup select server_var(playerlist_page) server_var(player_numbering) server_var(menu_block)
}
</pre>

WARNING MOD

Summary:

This script was built for administrators to keep track of trouble makers. The script takes information of every player that joins the server and creates a key for each. The key is backed up into a Data base file located in the same folder as the script after each map start. The main objective of this script is to wait for an admin to put a warning against a players name/steamid. When the "warning" is added to their name, it will calculate and check if their warnings exceed the Temp Ban or perm ban amounts. If the event so happens that the warning limits are reached, the player is banned for the specified times.

How does it work:

You configure the parts required at the top of the mod, adding player steamids into the script as "Admins" and setting ban times etc. Once the mod is configured and loaded (installation instructions are below) you simply type: !warning into chat and the script will compile a popup with the name of each player in the server (dead/alive/speccing). Simply press the number next to the players name and you are done. The script will add a strike against their name until they reach the limit you specify, then they are banned.

How do I install it:

You install it by simply creating a folder called: Warning inside Cstrike/Addons/Eventscripts/. Then copy and paste the script below into a blank notepad file. Once pasted, save the file as es_warning.txt and you are done. Once extracted saved, go into autoexec.cfg or server.cfg and type es_load warning then save. Alternatively, instead of editing autoexec.cfg or server.cfg you can simply type es_load warning into console and change the map.

ENJOY

Posts

  • 7y
    im_the_new_guy avatar
    im_the_new_guy avatar Offline
    Member Joined 8y
    2,869 points Ranked 1599th
    22 medals 1 legendary 3 rare
    • Submitted 50 Maps Medal icon
    • 6 years a member Medal icon
    • Returned 1000 times Medal icon
    • Submitted 20 Maps Medal icon
    • Mapper of the Month, November 2013 Medal icon
    • Mapper of the Month, December 2013 Medal icon
    @ fibbs.

    Thanks mate. Forgot to fix that haha.
    Creator of Hide N Seek mod
  • 7y
    Fibbs avatar
    Fibbs avatar Offline
    Member Joined 10y
    29,089 points Ranked 147th
    23 medals 1 rare
    • 6 years a member Medal icon
    • Prefaber of the Month, June 2012 Medal icon
    • MiPper of the Month, June 2012 Medal icon
    • Prefaber of the Month, March 2013 Medal icon
    • Texturer of the Month, July 2014 Medal icon
    • Became a Studio Leader Medal icon
    Very nice! I like the idea.

    Just a note though, I wouldn't use ma_ban as not all servers use mani admin. Use banid instead?

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Key Authors
Im the new guy
Creator

Submitter

im_the_new_guy avatar
im_the_new_guy avatar Offline
Member Joined 8y
2,869 points Ranked 1599th
22 medals 1 legendary 3 rare
  • Submitted 50 Maps Medal icon
  • 6 years a member Medal icon
  • Returned 1000 times Medal icon
  • Submitted 20 Maps Medal icon
  • Mapper of the Month, November 2013 Medal icon
  • Mapper of the Month, December 2013 Medal icon

im_the_new_guy avatar
im_the_new_guy

Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!
Sign up to access this!

Attributes

Miscellaneous

Stats

Posts
2
Views
1,988
Date Added
7y
Date Modified
7y
bcp.crwdcntrl.net tracking pixel