Популяризирай сървър

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit 8f85774828eb7977330641f422965911254bb0fa
4 changed files with 131 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2025-10-26)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Spray ID</strong> tells everyone who just sprayed. Spraying fires impulse 201, which the plugin catches; it traces from the player's aim to the wall to locate the decal and prints the sprayer's name and coordinates to chat (or only to admins). A per-player cooldown stops spray spam from flooding the console.</p><p>Inspired by the classic Spray Detector plugins. Independent GPL re-implementation.</p><h2>Features</h2><ul><li>Catches the spray impulse directly &mdash; no guessing.</li><li>Reports the sprayer's name and the wall location.</li><li>Public or admins-only output via <code>csb_sprayid_adminsonly</code>.</li><li>Per-player cooldown against spray spam.</li></ul><h2>Installation</h2><ol><li>Enable the <code>engine</code> module in <code>modules.ini</code>.</li><li>Compile <code>csb_spray_id.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>
+86 -0 addons/amxmodx/scripting/csb_spray_id.sma A
@@ -0,0 +1,86 @@
1 +/*
2 + * CSB Spray ID
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Announces who sprayed a logo. The spray action fires impulse 201, which this
6 + * plugin catches; it traces from the player's aim to the wall to locate the
7 + * decal, then prints the sprayer's name to everyone (or only to admins). A
8 + * per-player cooldown stops spray spam from flooding chat.
9 + *
10 + * Inspired by the classic Spray Detector plugins. Independent GPL
11 + * re-implementation.
12 + *
13 + * This program is free software: you can redistribute it and/or modify it under
14 + * the terms of the GNU General Public License as published by the Free Software
15 + * Foundation, either version 3 of the License, or (at your option) any later
16 + * version. It is distributed in the hope that it will be useful, but WITHOUT
17 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 + * FOR A PARTICULAR PURPOSE. See <https://www.gnu.org/licenses/> for details.
19 + */
20 +
21 +#include <amxmodx>
22 +#include <engine>
23 +
24 +new const PLUGIN[] = "CSB Spray ID"
25 +new const VERSION[] = "1.0.0"
26 +new const AUTHOR[] = "counter-strike-boost.com"
27 +
28 +new g_pEnabled, g_pAdminsOnly, g_pCooldown
29 +new Float:g_fLastSpray[33]
30 +
31 +public plugin_init()
32 +{
33 + register_plugin(PLUGIN, VERSION, AUTHOR)
34 +
35 + g_pEnabled = register_cvar("csb_sprayid_enabled", "1")
36 + g_pAdminsOnly = register_cvar("csb_sprayid_adminsonly", "0")
37 + g_pCooldown = register_cvar("csb_sprayid_cooldown", "3.0")
38 +
39 + register_impulse(201, "impulseSpray")
40 +}
41 +
42 +public client_putinserver(id)
43 +{
44 + g_fLastSpray[id] = 0.0
45 +}
46 +
47 +public impulseSpray(id)
48 +{
49 + if (!get_pcvar_num(g_pEnabled) || !is_user_connected(id))
50 + return PLUGIN_CONTINUE
51 +
52 + new Float:cd = get_pcvar_float(g_pCooldown)
53 +
54 + if (get_gametime() - g_fLastSpray[id] < cd)
55 + return PLUGIN_CONTINUE
56 +
57 + g_fLastSpray[id] = get_gametime()
58 +
59 + new name[32]
60 + get_user_name(id, name, charsmax(name))
61 +
62 + /* aim end point traced to the world */
63 + new origin[3]
64 + get_user_origin(id, origin, 3)
65 +
66 + new msg[128]
67 + formatex(msg, charsmax(msg), "^x04[Spray]^x01 %s sprayed a logo at (%d %d %d).", name, origin[0], origin[1], origin[2])
68 +
69 + if (get_pcvar_num(g_pAdminsOnly))
70 + {
71 + new players[32], num
72 + get_players(players, num, "ch")
73 +
74 + for (new i = 0; i < num; i++)
75 + {
76 + if (get_user_flags(players[i]) & ADMIN_KICK)
77 + client_print(players[i], print_chat, "%s", msg)
78 + }
79 + }
80 + else
81 + {
82 + client_print(0, print_chat, "%s", msg)
83 + }
84 +
85 + return PLUGIN_CONTINUE
86 +}
+41 -0 csb.json A
@@ -0,0 +1,41 @@
1 +{
2 + "name": "CSB Spray ID",
3 + "category": "fun",
4 + "tags": "spray, logo, admin",
5 + "image": "",
6 + "original_author": "Spray Detector (concept)",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Spray ID",
10 + "short_desc": "Announces who sprayed a logo and where, by catching the spray impulse and tracing to the wall, with an anti-spam cooldown.",
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": "engine",
20 + "install_notes": "1. Enable the engine module in addons/amxmodx/configs/modules.ini\n2. Put csb_spray_id.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Change map",
21 + "known_conflicts": "",
22 + "cvars": [
23 + {
24 + "name": "csb_sprayid_enabled",
25 + "default": "1",
26 + "description": "Enable or disable spray announcements."
27 + },
28 + {
29 + "name": "csb_sprayid_adminsonly",
30 + "default": "0",
31 + "description": "Show announcements only to admins."
32 + },
33 + {
34 + "name": "csb_sprayid_cooldown",
35 + "default": "3.0",
36 + "description": "Seconds between announcements per player."
37 + }
38 + ],
39 + "commands": [],
40 + "main": "addons/amxmodx/scripting/csb_spray_id.sma"
41 +}
0 42