/* * CSB Funny Slap Menu * Copyright (C) 2026 counter-strike-boost.com * * Fun slap tools for admins, all built on pev_velocity plus a sound and an * announcement: a harmless slap that flings the target in a random direction, a * "rocket slap" that launches them straight up, and a mass slap that lifts the * whole team at once. Opened from a menu and gated behind an access flag. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. It is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See for details. */ #include #include #include #include new const PLUGIN[] = "CSB Funny Slap Menu" new const VERSION[] = "1.0.0" new const AUTHOR[] = "counter-strike-boost.com" #define ACCESS_FLAG ADMIN_SLAY public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /slapmenu", "cmdMenu") register_clcmd("say_team /slapmenu", "cmdMenu") register_concmd("amx_funslap", "cmdFunSlap", ACCESS_FLAG, " - random-direction slap") register_concmd("amx_rocketslap", "cmdRocketSlap", ACCESS_FLAG, " - launch a player up") register_concmd("amx_massslap", "cmdMassSlap", ACCESS_FLAG, " - slap a whole team") } bool:hasAccess(id) { return (get_user_flags(id) & ACCESS_FLAG) != 0 } public cmdMenu(id) { if (!hasAccess(id)) { client_print(id, print_chat, "[CSB] You do not have access to the slap menu.") return PLUGIN_HANDLED } new menu = menu_create("\yCSB Slap Menu", "menuTool") menu_additem(menu, "\wFun Slap (random)", "1", 0) menu_additem(menu, "\wRocket Slap (up)", "2", 0) menu_additem(menu, "\wMass Slap Terrorists", "3", 0) menu_additem(menu, "\wMass Slap CTs", "4", 0) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu, 0) return PLUGIN_HANDLED } public menuTool(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new info[4], name[32], access, callback menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback) menu_destroy(menu) new tool = str_to_num(info) switch (tool) { case 1, 2: showTargetMenu(id, tool) case 3: massSlap(id, 1) case 4: massSlap(id, 2) } return PLUGIN_HANDLED } showTargetMenu(id, tool) { new title[48] formatex(title, charsmax(title), "\yPick a target^n\w(%s)", tool == 2 ? "rocket slap" : "fun slap") new menu = menu_create(title, tool == 2 ? "menuRocketTarget" : "menuFunTarget") new players[32], num, info[8], name[32] get_players(players, num, "h") for (new i = 0; i < num; i++) { get_user_name(players[i], name, charsmax(name)) num_to_str(get_user_userid(players[i]), info, charsmax(info)) menu_additem(menu, name, info, 0) } menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu, 0) } public menuFunTarget(id, menu, item) { return targetSelected(id, menu, item, false) } public menuRocketTarget(id, menu, item) { return targetSelected(id, menu, item, true) } targetSelected(id, menu, item, bool:rocket) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new info[8], name[32], access, callback menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback) menu_destroy(menu) new target = find_player("k", str_to_num(info)) if (!target || !is_user_alive(target)) { client_print(id, print_chat, "[CSB] That player is not alive.") return PLUGIN_HANDLED } if (rocket) rocketSlap(id, target) else funSlap(id, target) return PLUGIN_HANDLED } funSlap(admin, target) { static Float:fVel[3] pev(target, pev_velocity, fVel) fVel[0] += float(random_num(-300, 300)) fVel[1] += float(random_num(-300, 300)) fVel[2] += float(random_num(200, 400)) set_pev(target, pev_velocity, fVel) emit_sound(target, CHAN_BODY, "player/pl_slap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) announce(admin, target, "fun-slapped") } rocketSlap(admin, target) { static Float:fVel[3] pev(target, pev_velocity, fVel) fVel[2] = 800.0 set_pev(target, pev_velocity, fVel) emit_sound(target, CHAN_BODY, "player/pl_slap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) announce(admin, target, "rocket-slapped") } massSlap(admin, team) { if (!hasAccess(admin)) return new players[32], num get_players(players, num, "ae") new count = 0 for (new i = 0; i < num; i++) { if (get_user_team(players[i]) != team) continue static Float:fVel[3] pev(players[i], pev_velocity, fVel) fVel[2] = 700.0 set_pev(players[i], pev_velocity, fVel) emit_sound(players[i], CHAN_BODY, "player/pl_slap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) count++ } new aname[32] get_user_name(admin, aname, charsmax(aname)) client_print(0, print_chat, "[CSB] Admin %s mass-slapped %d %s!", aname, count, team == 1 ? "Terrorists" : "CTs") } announce(admin, target, const what[]) { new aname[32], tname[32] get_user_name(admin, aname, charsmax(aname)) get_user_name(target, tname, charsmax(tname)) client_print(0, print_chat, "[CSB] Admin %s %s %s!", aname, what, tname) } /* console command wrappers */ public cmdFunSlap(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32] read_argv(1, arg, charsmax(arg)) new t = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ONLY_ALIVE) if (t) funSlap(id, t) return PLUGIN_HANDLED } public cmdRocketSlap(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32] read_argv(1, arg, charsmax(arg)) new t = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ONLY_ALIVE) if (t) rocketSlap(id, t) return PLUGIN_HANDLED } public cmdMassSlap(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[4] read_argv(1, arg, charsmax(arg)) new team = equali(arg, "CT") ? 2 : 1 massSlap(id, team) return PLUGIN_HANDLED }