Server bewerben

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit 0049ed59f618bfd6c4b4e96467f46e1b484cae24
4 changed files with 300 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2025-07-13)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Funny Slap Menu</strong> collects the fun slap tools into one menu. Every tool works by setting the target's velocity and playing a slap sound with a public announcement: a harmless <strong>fun slap</strong> flings the player in a random direction, a <strong>rocket slap</strong> launches them straight up, and a <strong>mass slap</strong> lifts an entire team at once. Everything is gated behind an access flag, and console commands are provided alongside the menu.</p><h2>Features</h2><ul><li><code>/slapmenu</code> opens a picker for fun slap, rocket slap and mass slap.</li><li>Console commands: <code>amx_funslap</code>, <code>amx_rocketslap</code>, <code>amx_massslap</code>.</li><li>Zero-damage: it only moves players, so nobody dies from a slap.</li><li>Access gated behind the <code>ADMIN_SLAY</code> flag.</li></ul><h2>Installation</h2><ol><li>Enable the <code>fakemeta</code> and <code>fun</code> modules in <code>modules.ini</code>.</li><li>Compile <code>csb_slap_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>
+250 -0 addons/amxmodx/scripting/csb_slap_menu.sma A
@@ -0,0 +1,250 @@
1 +/*
2 + * CSB Funny Slap Menu
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Fun slap tools for admins, all built on pev_velocity plus a sound and an
6 + * announcement: a harmless slap that flings the target in a random direction, a
7 + * "rocket slap" that launches them straight up, and a mass slap that lifts the
8 + * whole team at once. Opened from a menu and gated behind an access flag.
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 +#include <amxmisc>
20 +#include <fakemeta>
21 +#include <fun>
22 +
23 +new const PLUGIN[] = "CSB Funny Slap Menu"
24 +new const VERSION[] = "1.0.0"
25 +new const AUTHOR[] = "counter-strike-boost.com"
26 +
27 +#define ACCESS_FLAG ADMIN_SLAY
28 +
29 +public plugin_init()
30 +{
31 + register_plugin(PLUGIN, VERSION, AUTHOR)
32 +
33 + register_clcmd("say /slapmenu", "cmdMenu")
34 + register_clcmd("say_team /slapmenu", "cmdMenu")
35 +
36 + register_concmd("amx_funslap", "cmdFunSlap", ACCESS_FLAG, "<target> - random-direction slap")
37 + register_concmd("amx_rocketslap", "cmdRocketSlap", ACCESS_FLAG, "<target> - launch a player up")
38 + register_concmd("amx_massslap", "cmdMassSlap", ACCESS_FLAG, "<T|CT> - slap a whole team")
39 +}
40 +
41 +bool:hasAccess(id)
42 +{
43 + return (get_user_flags(id) & ACCESS_FLAG) != 0
44 +}
45 +
46 +public cmdMenu(id)
47 +{
48 + if (!hasAccess(id))
49 + {
50 + client_print(id, print_chat, "[CSB] You do not have access to the slap menu.")
51 + return PLUGIN_HANDLED
52 + }
53 +
54 + new menu = menu_create("\yCSB Slap Menu", "menuTool")
55 + menu_additem(menu, "\wFun Slap (random)", "1", 0)
56 + menu_additem(menu, "\wRocket Slap (up)", "2", 0)
57 + menu_additem(menu, "\wMass Slap Terrorists", "3", 0)
58 + menu_additem(menu, "\wMass Slap CTs", "4", 0)
59 + menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
60 + menu_display(id, menu, 0)
61 + return PLUGIN_HANDLED
62 +}
63 +
64 +public menuTool(id, menu, item)
65 +{
66 + if (item == MENU_EXIT)
67 + {
68 + menu_destroy(menu)
69 + return PLUGIN_HANDLED
70 + }
71 +
72 + new info[4], name[32], access, callback
73 + menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback)
74 + menu_destroy(menu)
75 +
76 + new tool = str_to_num(info)
77 +
78 + switch (tool)
79 + {
80 + case 1, 2: showTargetMenu(id, tool)
81 + case 3: massSlap(id, 1)
82 + case 4: massSlap(id, 2)
83 + }
84 +
85 + return PLUGIN_HANDLED
86 +}
87 +
88 +showTargetMenu(id, tool)
89 +{
90 + new title[48]
91 + formatex(title, charsmax(title), "\yPick a target^n\w(%s)", tool == 2 ? "rocket slap" : "fun slap")
92 +
93 + new menu = menu_create(title, tool == 2 ? "menuRocketTarget" : "menuFunTarget")
94 +
95 + new players[32], num, info[8], name[32]
96 + get_players(players, num, "h")
97 +
98 + for (new i = 0; i < num; i++)
99 + {
100 + get_user_name(players[i], name, charsmax(name))
101 + num_to_str(get_user_userid(players[i]), info, charsmax(info))
102 + menu_additem(menu, name, info, 0)
103 + }
104 +
105 + menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
106 + menu_display(id, menu, 0)
107 +}
108 +
109 +public menuFunTarget(id, menu, item)
110 +{
111 + return targetSelected(id, menu, item, false)
112 +}
113 +
114 +public menuRocketTarget(id, menu, item)
115 +{
116 + return targetSelected(id, menu, item, true)
117 +}
118 +
119 +targetSelected(id, menu, item, bool:rocket)
120 +{
121 + if (item == MENU_EXIT)
122 + {
123 + menu_destroy(menu)
124 + return PLUGIN_HANDLED
125 + }
126 +
127 + new info[8], name[32], access, callback
128 + menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback)
129 + menu_destroy(menu)
130 +
131 + new target = find_player("k", str_to_num(info))
132 +
133 + if (!target || !is_user_alive(target))
134 + {
135 + client_print(id, print_chat, "[CSB] That player is not alive.")
136 + return PLUGIN_HANDLED
137 + }
138 +
139 + if (rocket)
140 + rocketSlap(id, target)
141 + else
142 + funSlap(id, target)
143 +
144 + return PLUGIN_HANDLED
145 +}
146 +
147 +funSlap(admin, target)
148 +{
149 + static Float:fVel[3]
150 + pev(target, pev_velocity, fVel)
151 +
152 + fVel[0] += float(random_num(-300, 300))
153 + fVel[1] += float(random_num(-300, 300))
154 + fVel[2] += float(random_num(200, 400))
155 +
156 + set_pev(target, pev_velocity, fVel)
157 +
158 + emit_sound(target, CHAN_BODY, "player/pl_slap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
159 + announce(admin, target, "fun-slapped")
160 +}
161 +
162 +rocketSlap(admin, target)
163 +{
164 + static Float:fVel[3]
165 + pev(target, pev_velocity, fVel)
166 + fVel[2] = 800.0
167 + set_pev(target, pev_velocity, fVel)
168 +
169 + emit_sound(target, CHAN_BODY, "player/pl_slap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
170 + announce(admin, target, "rocket-slapped")
171 +}
172 +
173 +massSlap(admin, team)
174 +{
175 + if (!hasAccess(admin))
176 + return
177 +
178 + new players[32], num
179 + get_players(players, num, "ae")
180 +
181 + new count = 0
182 + for (new i = 0; i < num; i++)
183 + {
184 + if (get_user_team(players[i]) != team)
185 + continue
186 +
187 + static Float:fVel[3]
188 + pev(players[i], pev_velocity, fVel)
189 + fVel[2] = 700.0
190 + set_pev(players[i], pev_velocity, fVel)
191 + emit_sound(players[i], CHAN_BODY, "player/pl_slap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
192 + count++
193 + }
194 +
195 + new aname[32]
196 + get_user_name(admin, aname, charsmax(aname))
197 + client_print(0, print_chat, "[CSB] Admin %s mass-slapped %d %s!", aname, count, team == 1 ? "Terrorists" : "CTs")
198 +}
199 +
200 +announce(admin, target, const what[])
201 +{
202 + new aname[32], tname[32]
203 + get_user_name(admin, aname, charsmax(aname))
204 + get_user_name(target, tname, charsmax(tname))
205 + client_print(0, print_chat, "[CSB] Admin %s %s %s!", aname, what, tname)
206 +}
207 +
208 +/* console command wrappers */
209 +public cmdFunSlap(id, level, cid)
210 +{
211 + if (!cmd_access(id, level, cid, 2))
212 + return PLUGIN_HANDLED
213 +
214 + new arg[32]
215 + read_argv(1, arg, charsmax(arg))
216 + new t = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ONLY_ALIVE)
217 +
218 + if (t)
219 + funSlap(id, t)
220 +
221 + return PLUGIN_HANDLED
222 +}
223 +
224 +public cmdRocketSlap(id, level, cid)
225 +{
226 + if (!cmd_access(id, level, cid, 2))
227 + return PLUGIN_HANDLED
228 +
229 + new arg[32]
230 + read_argv(1, arg, charsmax(arg))
231 + new t = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ONLY_ALIVE)
232 +
233 + if (t)
234 + rocketSlap(id, t)
235 +
236 + return PLUGIN_HANDLED
237 +}
238 +
239 +public cmdMassSlap(id, level, cid)
240 +{
241 + if (!cmd_access(id, level, cid, 2))
242 + return PLUGIN_HANDLED
243 +
244 + new arg[4]
245 + read_argv(1, arg, charsmax(arg))
246 +
247 + new team = equali(arg, "CT") ? 2 : 1
248 + massSlap(id, team)
249 + return PLUGIN_HANDLED
250 +}
+46 -0 csb.json A
@@ -0,0 +1,46 @@
1 +{
2 + "name": "CSB Funny Slap Menu",
3 + "category": "fun",
4 + "tags": "slap, fun, punish",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Funny Slap Menu",
10 + "short_desc": "Admin slap toys: a random-direction fun slap, a rocket slap that launches a player up, and a mass team slap, all with sound and announcements.",
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,fun",
20 + "install_notes": "1. Enable the fakemeta and fun modules in addons/amxmodx/configs/modules.ini\n2. Put csb_slap_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 /slapmenu",
26 + "access": "d (ADMIN_SLAY)",
27 + "description": "Open the slap menu."
28 + },
29 + {
30 + "name": "amx_funslap",
31 + "access": "d (ADMIN_SLAY)",
32 + "description": "amx_funslap <target> - random-direction slap."
33 + },
34 + {
35 + "name": "amx_rocketslap",
36 + "access": "d (ADMIN_SLAY)",
37 + "description": "amx_rocketslap <target> - launch a player up."
38 + },
39 + {
40 + "name": "amx_massslap",
41 + "access": "d (ADMIN_SLAY)",
42 + "description": "amx_massslap <T|CT> - slap a whole team."
43 + }
44 + ],
45 + "main": "addons/amxmodx/scripting/csb_slap_menu.sma"
46 +}
0 47