Server bewerben

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit 5da254f4e09ef7244dea644ac593b67021073bdb
4 changed files with 189 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 Admin Noclip</strong> is a safe re-implementation of the classic admin fly. <code>amx_noclip</code> (bind a key to it) toggles <code>MOVETYPE_NOCLIP</code> so an admin can move through walls to spectate or set up. A HUD marker shows while it is on, and it is force-disabled on death and at the start of every round so it can never leak into live play. An optional cvar strips the attack buttons in <code>FM_CmdStart</code> while noclipping, so it cannot be abused to shoot from inside geometry.</p><p>Inspired by the AMX Mod X admin commands. Independent GPL re-implementation.</p><h2>Features</h2><ul><li><code>amx_noclip</code> toggle (default flag <code>ADMIN_CVAR</code> / <code>o</code>).</li><li>HUD <code>[ NOCLIP ]</code> marker while active.</li><li>Auto-off on death and at round start.</li><li><code>csb_noclip_blockfire</code> blocks weapon fire while noclipping.</li></ul><h2>Installation</h2><ol><li>Enable the <code>fakemeta</code> module in <code>modules.ini</code>.</li><li>Compile <code>csb_admin_noclip.sma</code>, copy it to <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>.</li><li>Change the map, then <code>bind n amx_noclip</code>.</li></ol>
+143 -0 addons/amxmodx/scripting/csb_admin_noclip.sma A
@@ -0,0 +1,143 @@
1 +/*
2 + * CSB Admin Noclip
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Toggles MOVETYPE_NOCLIP for admins with amx_noclip (bind a key to it too).
6 + * A HUD marker shows while noclip is on, and it is disabled automatically on
7 + * death and at the start of every round so it cannot be carried into play.
8 + * A cvar blocks weapon fire while noclipping so it cannot be abused mid-fight.
9 + *
10 + * Inspired by the AMX Mod X admin commands. Independent GPL re-implementation.
11 + *
12 + * This program is free software: you can redistribute it and/or modify it under
13 + * the terms of the GNU General Public License as published by the Free Software
14 + * Foundation, either version 3 of the License, or (at your option) any later
15 + * version. It is distributed in the hope that it will be useful, but WITHOUT
16 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 + * FOR A PARTICULAR PURPOSE. See <https://www.gnu.org/licenses/> for details.
18 + */
19 +
20 +#include <amxmodx>
21 +#include <amxmisc>
22 +#include <fakemeta>
23 +
24 +new const PLUGIN[] = "CSB Admin Noclip"
25 +new const VERSION[] = "1.0.0"
26 +new const AUTHOR[] = "counter-strike-boost.com"
27 +
28 +#define MOVETYPE_WALK 3
29 +#define MOVETYPE_NOCLIP 8
30 +
31 +#define IN_ATTACK (1<<0)
32 +#define IN_ATTACK2 (1<<11)
33 +
34 +#define ACCESS_FLAG ADMIN_CVAR
35 +
36 +new g_pEnabled, g_pBlockFire
37 +new bool:g_bNoclip[33]
38 +new g_iSync
39 +
40 +public plugin_init()
41 +{
42 + register_plugin(PLUGIN, VERSION, AUTHOR)
43 +
44 + g_pEnabled = register_cvar("csb_noclip_enabled", "1")
45 + g_pBlockFire = register_cvar("csb_noclip_blockfire", "1")
46 +
47 + register_concmd("amx_noclip", "cmdNoclip", ACCESS_FLAG, "- toggle noclip on yourself")
48 +
49 + register_event("DeathMsg", "eventDeath", "a", "1>0")
50 + register_event("HLTV", "eventNewRound", "a", "1=0", "2=0")
51 +
52 + register_forward(FM_CmdStart, "fwCmdStart")
53 +
54 + g_iSync = CreateHudSyncObj()
55 + set_task(0.5, "taskHud", 0, _, _, "b")
56 +}
57 +
58 +public client_putinserver(id)
59 +{
60 + g_bNoclip[id] = false
61 +}
62 +
63 +public cmdNoclip(id, level, cid)
64 +{
65 + if (!cmd_access(id, level, cid, 1))
66 + return PLUGIN_HANDLED
67 +
68 + if (!get_pcvar_num(g_pEnabled))
69 + {
70 + console_print(id, "[CSB] Noclip is disabled.")
71 + return PLUGIN_HANDLED
72 + }
73 +
74 + if (!is_user_alive(id))
75 + {
76 + client_print(id, print_chat, "[CSB] You must be alive to noclip.")
77 + return PLUGIN_HANDLED
78 + }
79 +
80 + setNoclip(id, !g_bNoclip[id])
81 + client_print(id, print_chat, "[CSB] Noclip %s.", g_bNoclip[id] ? "ON" : "OFF")
82 + return PLUGIN_HANDLED
83 +}
84 +
85 +setNoclip(id, bool:on)
86 +{
87 + g_bNoclip[id] = on
88 + set_pev(id, pev_movetype, on ? MOVETYPE_NOCLIP : MOVETYPE_WALK)
89 +}
90 +
91 +public eventDeath()
92 +{
93 + new victim = read_data(2)
94 +
95 + if (victim >= 1 && victim <= 32 && g_bNoclip[victim])
96 + g_bNoclip[victim] = false
97 +}
98 +
99 +public eventNewRound()
100 +{
101 + for (new id = 1; id <= 32; id++)
102 + {
103 + if (g_bNoclip[id])
104 + {
105 + g_bNoclip[id] = false
106 +
107 + if (is_user_alive(id))
108 + set_pev(id, pev_movetype, MOVETYPE_WALK)
109 + }
110 + }
111 +}
112 +
113 +public fwCmdStart(id, uc_handle, seed)
114 +{
115 + if (!g_bNoclip[id] || !get_pcvar_num(g_pBlockFire))
116 + return FMRES_IGNORED
117 +
118 + new buttons = get_uc(uc_handle, UC_Buttons)
119 +
120 + if (buttons & (IN_ATTACK | IN_ATTACK2))
121 + {
122 + buttons &= ~(IN_ATTACK | IN_ATTACK2)
123 + set_uc(uc_handle, UC_Buttons, buttons)
124 + }
125 +
126 + return FMRES_HANDLED
127 +}
128 +
129 +public taskHud()
130 +{
131 + new players[32], num
132 + get_players(players, num, "ch")
133 +
134 + set_hudmessage(0, 255, 255, 0.75, 0.85, 0, 0.0, 0.6, 0.0, 0.0, -1)
135 +
136 + for (new i = 0; i < num; i++)
137 + {
138 + new id = players[i]
139 +
140 + if (g_bNoclip[id])
141 + ShowSyncHudMsg(id, g_iSync, "[ NOCLIP ]")
142 + }
143 +}
+42 -0 csb.json A
@@ -0,0 +1,42 @@
1 +{
2 + "name": "CSB Admin Noclip",
3 + "category": "movement",
4 + "tags": "noclip, admin, fly",
5 + "image": "",
6 + "original_author": "AMX Mod X Admin Commands",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Admin Noclip",
10 + "short_desc": "Toggle MOVETYPE_NOCLIP for admins with a HUD marker; auto-off on death and round start, with an optional fire block.",
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": "fakemeta",
20 + "install_notes": "1. Enable the fakemeta module in addons/amxmodx/configs/modules.ini\n2. Put csb_admin_noclip.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Change map\n4. bind a key to amx_noclip",
21 + "known_conflicts": "Other plugins that set pev_movetype on players (freeze, gravity toys) can override the noclip state.",
22 + "cvars": [
23 + {
24 + "name": "csb_noclip_enabled",
25 + "default": "1",
26 + "description": "Enable or disable the noclip command."
27 + },
28 + {
29 + "name": "csb_noclip_blockfire",
30 + "default": "1",
31 + "description": "Block weapon fire while a player is noclipping."
32 + }
33 + ],
34 + "commands": [
35 + {
36 + "name": "amx_noclip",
37 + "access": "o (ADMIN_CVAR)",
38 + "description": "Toggle noclip on yourself."
39 + }
40 + ],
41 + "main": "addons/amxmodx/scripting/csb_admin_noclip.sma"
42 +}
0 43