Sunucu tanitimi

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit dd91c2ac204ad7a350bf4f43108c2b877e75ea49
4 changed files with 219 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2026-04-02)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Server Info</strong> puts everything a newcomer needs behind one command. Type <code>say /info</code> to open a menu with five pages, each shown as an MOTD so links are clickable: the <strong>server rules</strong>, the <strong>online admin</strong> list (built live from who is connected), the common <strong>chat commands</strong>, your <strong>community links</strong> (Discord and website, read from an ini), and the <strong>current settings</strong> - friendly fire, max rounds, time limit and player count read straight from the cvars.</p><h2>Features</h2><ul><li>Five-page info menu, each rendered as an MOTD.</li><li>Online admin list generated live from connected players.</li><li>Discord and website links loaded from <code>csb_info.ini</code>.</li><li>Current-settings page reads friendly fire, rounds and time limit from cvars.</li></ul><h2>Installation</h2><ol><li>Optionally set <code>discord=</code> and <code>website=</code> in <code>addons/amxmodx/configs/csb_info.ini</code>.</li><li>Compile <code>csb_server_info_menu.sma</code>, copy it to <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>.</li><li>Change the map.</li></ol>
+184 -0 addons/amxmodx/scripting/csb_server_info_menu.sma A
@@ -0,0 +1,184 @@
1 +/*
2 + * CSB Server Info
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * "say /info" opens a menu of server information: the rules, the online admin
6 + * list, the common chat commands, community links (Discord / website) read from
7 + * an ini, and the current match settings (friendly fire, max rounds, timelimit).
8 + * Each entry is shown as an MOTD window so links are clickable.
9 + *
10 + * This program is free software: you can redistribute it and/or modify it under
11 + * the terms of the GNU General Public License as published by the Free Software
12 + * Foundation, either version 3 of the License, or (at your option) any later
13 + * version. It is distributed in the hope that it will be useful, but WITHOUT
14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 + * FOR A PARTICULAR PURPOSE. See <https://www.gnu.org/licenses/> for details.
16 + */
17 +
18 +#include <amxmodx>
19 +
20 +new const PLUGIN[] = "CSB Server Info"
21 +new const VERSION[] = "1.0.0"
22 +new const AUTHOR[] = "counter-strike-boost.com"
23 +
24 +new g_szDiscord[128]
25 +new g_szWebsite[128]
26 +
27 +public plugin_init()
28 +{
29 + register_plugin(PLUGIN, VERSION, AUTHOR)
30 +
31 + register_clcmd("say /info", "cmdInfo")
32 + register_clcmd("say_team /info", "cmdInfo")
33 +}
34 +
35 +public plugin_cfg()
36 +{
37 + copy(g_szDiscord, charsmax(g_szDiscord), "https://discord.gg/your-invite")
38 + copy(g_szWebsite, charsmax(g_szWebsite), "https://counter-strike-boost.com")
39 +
40 + new cfgdir[128], path[160]
41 + get_localinfo("amxx_configsdir", cfgdir, charsmax(cfgdir))
42 + formatex(path, charsmax(path), "%s/csb_info.ini", cfgdir)
43 +
44 + if (!file_exists(path))
45 + return
46 +
47 + new f = fopen(path, "rt")
48 +
49 + if (!f)
50 + return
51 +
52 + new line[192], key[32], value[128]
53 +
54 + while (!feof(f))
55 + {
56 + fgets(f, line, charsmax(line))
57 + trim(line)
58 +
59 + if (!line[0] || line[0] == ';' || line[0] == '#')
60 + continue
61 +
62 + strtok(line, key, charsmax(key), value, charsmax(value), '=')
63 + trim(key)
64 + trim(value)
65 +
66 + if (!value[0])
67 + continue
68 +
69 + if (equali(key, "discord"))
70 + copy(g_szDiscord, charsmax(g_szDiscord), value)
71 + else if (equali(key, "website"))
72 + copy(g_szWebsite, charsmax(g_szWebsite), value)
73 + }
74 +
75 + fclose(f)
76 +}
77 +
78 +public cmdInfo(id)
79 +{
80 + new menu = menu_create("\yServer Information\w", "infoHandler")
81 +
82 + menu_additem(menu, "Server Rules", "1", 0)
83 + menu_additem(menu, "Online Admins", "2", 0)
84 + menu_additem(menu, "Chat Commands", "3", 0)
85 + menu_additem(menu, "Community Links", "4", 0)
86 + menu_additem(menu, "Current Settings", "5", 0)
87 +
88 + menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
89 + menu_display(id, menu, 0)
90 + return PLUGIN_HANDLED
91 +}
92 +
93 +public infoHandler(id, menu, item)
94 +{
95 + if (item == MENU_EXIT)
96 + {
97 + menu_destroy(menu)
98 + return PLUGIN_HANDLED
99 + }
100 +
101 + new info[8], name[32], access, callback
102 + menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback)
103 + menu_destroy(menu)
104 +
105 + switch (str_to_num(info))
106 + {
107 + case 1: showRules(id)
108 + case 2: showAdmins(id)
109 + case 3: showCommands(id)
110 + case 4: showLinks(id)
111 + case 5: showSettings(id)
112 + }
113 +
114 + return PLUGIN_HANDLED
115 +}
116 +
117 +showRules(id)
118 +{
119 + show_motd(id,
120 + "1. Respect all players and admins.<br>2. No cheats, scripts or exploits.<br>3. No advertising or spam.<br>4. Admin decisions are final.",
121 + "Server Rules")
122 +}
123 +
124 +showAdmins(id)
125 +{
126 + new body[512]
127 + copy(body, charsmax(body), "Admins currently online:<br>")
128 +
129 + new players[32], num, count = 0
130 + get_players(players, num, "ch")
131 +
132 + new name[32], line[64]
133 +
134 + for (new i = 0; i < num; i++)
135 + {
136 + new pl = players[i]
137 +
138 + if (get_user_flags(pl) & ADMIN_KICK)
139 + {
140 + get_user_name(pl, name, charsmax(name))
141 + formatex(line, charsmax(line), "- %s<br>", name)
142 + add(body, charsmax(body), line)
143 + count++
144 + }
145 + }
146 +
147 + if (!count)
148 + add(body, charsmax(body), "(none online right now)")
149 +
150 + show_motd(id, body, "Online Admins")
151 +}
152 +
153 +showCommands(id)
154 +{
155 + show_motd(id,
156 + "/rules - server rules<br>/info - this menu<br>/players - who is online<br>/report - report a player<br>/rsounds - toggle round sounds",
157 + "Chat Commands")
158 +}
159 +
160 +showLinks(id)
161 +{
162 + new body[384]
163 + formatex(body, charsmax(body),
164 + "Join our community:<br><br>Discord: %s<br>Website: %s",
165 + g_szDiscord, g_szWebsite)
166 +
167 + show_motd(id, body, "Community Links")
168 +}
169 +
170 +showSettings(id)
171 +{
172 + new ff = get_cvar_num("mp_friendlyfire")
173 + new maxr = get_cvar_num("mp_maxrounds")
174 + new tl = get_cvar_num("mp_timelimit")
175 +
176 + new body[384]
177 + formatex(body, charsmax(body),
178 + "Friendly fire: %s<br>Max rounds: %d<br>Time limit: %d min<br>Players online: %d",
179 + ff ? "ON" : "OFF",
180 + maxr, tl,
181 + get_playersnum())
182 +
183 + show_motd(id, body, "Current Settings")
184 +}
+31 -0 csb.json A
@@ -0,0 +1,31 @@
1 +{
2 + "name": "CSB Server Info",
3 + "category": "hud-info",
4 + "tags": "info, menu, server",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Server Info",
10 + "short_desc": "A /info menu with rules, online admins, chat commands, Discord/website links and live match settings, shown as MOTD pages.",
11 + "version": "1.0.0",
12 + "amxx_min": "1.9",
13 + "amxx_compile_default": "1.9",
14 + "rehlds_ok": true,
15 + "hlds_ok": true,
16 + "regamedll_required": false,
17 + "metamod_flavor": "any",
18 + "reapi_required": false,
19 + "modules": "",
20 + "install_notes": "1. Optionally set discord= and website= in addons/amxmodx/configs/csb_info.ini\n2. Put csb_server_info_menu.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Change map",
21 + "known_conflicts": "",
22 + "cvars": [],
23 + "commands": [
24 + {
25 + "name": "say /info",
26 + "access": "",
27 + "description": "Open the server information menu."
28 + }
29 + ],
30 + "main": "addons/amxmodx/scripting/csb_server_info_menu.sma"
31 +}
0 32