Initial release 1.0.0
Browse Source1.0.0 — Initial release.
4 changed files
with 267 additions and 0 deletions
A
CHANGELOG.md
+3 -0
A
README.md
+1 -0
A
addons/amxmodx/scripting/csb_zombie_classes.sma
+221 -0
A
csb.json
+42 -0
CHANGELOG.md
A
| @@ -0,0 +1,3 @@ | ||
| 1 | +## 1.0.0 (2026-04-01) | |
| 2 | + | |
| 3 | +1.0.0 — Initial release. |
README.md
A
| @@ -0,0 +1 @@ | ||
| 1 | +<p>A <strong>class system</strong> that sits on top of <a href="/plugins/csb-zombie-core">CSB Zombie Core</a>. Players pick a zombie class from a menu; each class has its own health, speed, gravity, knockback and model. The choice is saved per player in nVault and applied automatically the moment they are infected, through the core's <code>csb_zombie_infected</code> forward. Bullet knockback is scaled by the class's knockback multiplier.</p><p><strong>Requires CSB Zombie Core</strong>, which provides <code>csb_is_zombie</code> and the infection forward. Independent GPL re-implementation inspired by <strong>Zombie Plague Classes</strong> by MeRcyLeZZ.</p><h2>Classes</h2><ul><li><strong>Classic</strong> — balanced all-rounder.</li><li><strong>Runner</strong> — fast but fragile.</li><li><strong>Tank</strong> — slow wall of health.</li><li><strong>Leaper</strong> — low gravity, big jumps.</li><li><strong>Hunter</strong> — high speed, takes more knockback.</li></ul><h2>Features</h2><ul><li><code>/zclass</code> menu; choice persisted per SteamID in nVault.</li><li>Stats applied on infection via the core forward — no polling.</li><li>Per-class bullet knockback on zombies.</li></ul><h2>Installation</h2><ol><li>Install <a href="/plugins/csb-zombie-core">CSB Zombie Core</a> first.</li><li>Put <code>csb_zombie_classes.amxx</code> in <code>addons/amxmodx/plugins/</code>.</li><li>Add it to <code>plugins.ini</code> <strong>below</strong> the core.</li><li>Change the map.</li></ol> |
addons/amxmodx/scripting/csb_zombie_classes.sma
A
| @@ -0,0 +1,221 @@ | ||
| 1 | +/* | |
| 2 | + * CSB Zombie Classes | |
| 3 | + * Copyright (C) 2026 counter-strike-boost.com | |
| 4 | + * | |
| 5 | + * A class system that sits on top of CSB Zombie Core. Players pick a zombie | |
| 6 | + * class from a menu (Classic, Runner, Tank, Leaper, Hunter); each class has its | |
| 7 | + * own health, speed, gravity, knockback and model. The choice is saved per | |
| 8 | + * player in nVault and applied automatically the moment they are infected, | |
| 9 | + * through the core's csb_zombie_infected forward. Bullet knockback is scaled | |
| 10 | + * by the class's knockback multiplier. | |
| 11 | + * | |
| 12 | + * Requires CSB Zombie Core (provides csb_is_zombie and the infection forward). | |
| 13 | + * Inspired by Zombie Plague Classes by MeRcyLeZZ. Independent GPL re-write. | |
| 14 | + * | |
| 15 | + * This program is free software: you can redistribute it and/or modify it | |
| 16 | + * under the terms of the GNU General Public License as published by the Free | |
| 17 | + * Software Foundation, either version 3 of the License, or (at your option) | |
| 18 | + * any later version. Distributed WITHOUT ANY WARRANTY. See the GNU General | |
| 19 | + * Public License for more details: <https://www.gnu.org/licenses/>. | |
| 20 | + */ | |
| 21 | + | |
| 22 | +#include <amxmodx> | |
| 23 | +#include <fakemeta> | |
| 24 | +#include <hamsandwich> | |
| 25 | +#include <cstrike> | |
| 26 | +#include <fun> | |
| 27 | +#include <nvault> | |
| 28 | + | |
| 29 | +// provided by CSB Zombie Core at runtime | |
| 30 | +native csb_is_zombie(id) | |
| 31 | + | |
| 32 | +new const PLUGIN[] = "CSB Zombie Classes" | |
| 33 | +new const VERSION[] = "1.0.0" | |
| 34 | +new const AUTHOR[] = "counter-strike-boost.com" | |
| 35 | + | |
| 36 | +// Class table: name, health, max speed, gravity, knockback, model. | |
| 37 | +new const g_szClassName[][] = { "Classic", "Runner", "Tank", "Leaper", "Hunter" } | |
| 38 | +new const g_szClassDesc[][] = | |
| 39 | +{ | |
| 40 | + "Balanced all-rounder", | |
| 41 | + "Fast but fragile", | |
| 42 | + "Slow wall of health", | |
| 43 | + "Low gravity, big jumps", | |
| 44 | + "High speed, high knockback taken" | |
| 45 | +} | |
| 46 | +new const g_iClassHp[] = { 2000, 1400, 4000, 1600, 1800 } | |
| 47 | +new const Float:g_fClassSpeed[] = { 250.0, 320.0, 220.0, 260.0, 300.0 } | |
| 48 | +new const Float:g_fClassGravity[] = { 0.85, 0.80, 1.00, 0.55, 0.80 } | |
| 49 | +new const Float:g_fClassKnock[] = { 1.0, 1.4, 0.6, 1.2, 1.6 } | |
| 50 | +new const g_szClassModel[][] = | |
| 51 | +{ | |
| 52 | + "zombie_source", "zombie_source", "zombie_source", "zombie_source", "zombie_source" | |
| 53 | +} | |
| 54 | + | |
| 55 | +new g_pEnabled | |
| 56 | +new g_iClass[33] | |
| 57 | +new g_iVault | |
| 58 | +new g_iMaxPlayers | |
| 59 | + | |
| 60 | +public plugin_init() | |
| 61 | +{ | |
| 62 | + register_plugin(PLUGIN, VERSION, AUTHOR) | |
| 63 | + | |
| 64 | + g_pEnabled = register_cvar("csb_zmclass_enabled", "1") | |
| 65 | + | |
| 66 | + register_clcmd("say /zclass", "cmdClassMenu") | |
| 67 | + register_clcmd("say /class", "cmdClassMenu") | |
| 68 | + | |
| 69 | + RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage", 0) | |
| 70 | + | |
| 71 | + g_iMaxPlayers = get_maxplayers() | |
| 72 | + g_iVault = nvault_open("csb_zm_classes") | |
| 73 | +} | |
| 74 | + | |
| 75 | +public plugin_end() | |
| 76 | +{ | |
| 77 | + if (g_iVault != INVALID_HANDLE) | |
| 78 | + nvault_close(g_iVault) | |
| 79 | +} | |
| 80 | + | |
| 81 | +public client_putinserver(id) | |
| 82 | +{ | |
| 83 | + g_iClass[id] = loadClass(id) | |
| 84 | +} | |
| 85 | + | |
| 86 | +// Called by CSB Zombie Core when a player becomes a zombie. | |
| 87 | +public csb_zombie_infected(id, infector) | |
| 88 | +{ | |
| 89 | + if (!get_pcvar_num(g_pEnabled) || !is_user_alive(id)) | |
| 90 | + return | |
| 91 | + | |
| 92 | + applyClass(id) | |
| 93 | +} | |
| 94 | + | |
| 95 | +applyClass(id) | |
| 96 | +{ | |
| 97 | + new c = g_iClass[id] | |
| 98 | + if (c < 0 || c >= sizeof(g_szClassName)) | |
| 99 | + c = 0 | |
| 100 | + | |
| 101 | + set_user_health(id, g_iClassHp[c]) | |
| 102 | + set_user_maxspeed(id, g_fClassSpeed[c]) | |
| 103 | + set_user_gravity(id, g_fClassGravity[c]) | |
| 104 | + | |
| 105 | + if (g_szClassModel[c][0]) | |
| 106 | + cs_set_user_model(id, g_szClassModel[c]) | |
| 107 | + | |
| 108 | + client_print(id, print_center, "Zombie class: %s", g_szClassName[c]) | |
| 109 | +} | |
| 110 | + | |
| 111 | +public cmdClassMenu(id) | |
| 112 | +{ | |
| 113 | + if (!get_pcvar_num(g_pEnabled)) | |
| 114 | + return PLUGIN_HANDLED | |
| 115 | + | |
| 116 | + new menu = menu_create("\yChoose your zombie class", "classHandler") | |
| 117 | + | |
| 118 | + new line[96], info[8] | |
| 119 | + for (new i = 0; i < sizeof(g_szClassName); i++) | |
| 120 | + { | |
| 121 | + formatex(info, charsmax(info), "%d", i) | |
| 122 | + formatex(line, charsmax(line), "%s \r[HP %d]^n\w%s", g_szClassName[i], g_iClassHp[i], g_szClassDesc[i]) | |
| 123 | + menu_additem(menu, line, info, 0) | |
| 124 | + } | |
| 125 | + | |
| 126 | + menu_setprop(menu, MPROP_EXITNAME, "Close") | |
| 127 | + menu_display(id, menu, 0) | |
| 128 | + return PLUGIN_HANDLED | |
| 129 | +} | |
| 130 | + | |
| 131 | +public classHandler(id, menu, item) | |
| 132 | +{ | |
| 133 | + if (item == MENU_EXIT) | |
| 134 | + { | |
| 135 | + menu_destroy(menu) | |
| 136 | + return PLUGIN_HANDLED | |
| 137 | + } | |
| 138 | + | |
| 139 | + new info[8], name[32], access, callback | |
| 140 | + menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback) | |
| 141 | + menu_destroy(menu) | |
| 142 | + | |
| 143 | + new c = str_to_num(info) | |
| 144 | + if (c < 0 || c >= sizeof(g_szClassName)) | |
| 145 | + return PLUGIN_HANDLED | |
| 146 | + | |
| 147 | + g_iClass[id] = c | |
| 148 | + saveClass(id, c) | |
| 149 | + | |
| 150 | + client_print(id, print_chat, "[Zombie] Class set to %s. It applies the next time you are infected.", g_szClassName[c]) | |
| 151 | + | |
| 152 | + // If already a zombie this round, apply immediately. | |
| 153 | + if (is_user_alive(id) && csb_is_zombie(id)) | |
| 154 | + applyClass(id) | |
| 155 | + | |
| 156 | + return PLUGIN_HANDLED | |
| 157 | +} | |
| 158 | + | |
| 159 | +public fwTakeDamage(victim, inflictor, attacker, Float:damage, damagebits) | |
| 160 | +{ | |
| 161 | + if (!get_pcvar_num(g_pEnabled)) | |
| 162 | + return HAM_IGNORED | |
| 163 | + | |
| 164 | + if (attacker < 1 || attacker > g_iMaxPlayers || attacker == victim) | |
| 165 | + return HAM_IGNORED | |
| 166 | + | |
| 167 | + // only human-on-zombie bullet damage produces knockback | |
| 168 | + if (!csb_is_zombie(victim) || csb_is_zombie(attacker)) | |
| 169 | + return HAM_IGNORED | |
| 170 | + | |
| 171 | + if (!is_user_alive(victim)) | |
| 172 | + return HAM_IGNORED | |
| 173 | + | |
| 174 | + new c = g_iClass[victim] | |
| 175 | + if (c < 0 || c >= sizeof(g_szClassName)) | |
| 176 | + c = 0 | |
| 177 | + | |
| 178 | + new Float:kb = g_fClassKnock[c] | |
| 179 | + if (kb <= 0.0) | |
| 180 | + return HAM_IGNORED | |
| 181 | + | |
| 182 | + new Float:oa[3], Float:ov[3], Float:dir[3] | |
| 183 | + pev(attacker, pev_origin, oa) | |
| 184 | + pev(victim, pev_origin, ov) | |
| 185 | + | |
| 186 | + dir[0] = ov[0] - oa[0] | |
| 187 | + dir[1] = ov[1] - oa[1] | |
| 188 | + | |
| 189 | + new Float:len = floatsqroot(dir[0] * dir[0] + dir[1] * dir[1]) | |
| 190 | + if (len <= 0.0) | |
| 191 | + return HAM_IGNORED | |
| 192 | + | |
| 193 | + new Float:power = damage * kb | |
| 194 | + new Float:vel[3] | |
| 195 | + pev(victim, pev_velocity, vel) | |
| 196 | + | |
| 197 | + vel[0] += dir[0] / len * power | |
| 198 | + vel[1] += dir[1] / len * power | |
| 199 | + set_pev(victim, pev_velocity, vel) | |
| 200 | + | |
| 201 | + return HAM_IGNORED | |
| 202 | +} | |
| 203 | + | |
| 204 | +saveClass(id, c) | |
| 205 | +{ | |
| 206 | + new authid[35], data[8] | |
| 207 | + get_user_authid(id, authid, charsmax(authid)) | |
| 208 | + formatex(data, charsmax(data), "%d", c) | |
| 209 | + nvault_set(g_iVault, authid, data) | |
| 210 | +} | |
| 211 | + | |
| 212 | +loadClass(id) | |
| 213 | +{ | |
| 214 | + new authid[35], data[8], timestamp | |
| 215 | + get_user_authid(id, authid, charsmax(authid)) | |
| 216 | + | |
| 217 | + if (nvault_lookup(g_iVault, authid, data, charsmax(data), timestamp)) | |
| 218 | + return clamp(str_to_num(data), 0, sizeof(g_szClassName) - 1) | |
| 219 | + | |
| 220 | + return 0 | |
| 221 | +} |
csb.json
A
| @@ -0,0 +1,42 @@ | ||
| 1 | +{ | |
| 2 | + "name": "CSB Zombie Classes", | |
| 3 | + "category": "zombie", | |
| 4 | + "tags": "classes, zombie, menu", | |
| 5 | + "image": "", | |
| 6 | + "original_author": "MeRcyLeZZ (Zombie Plague Classes)", | |
| 7 | + "original_url": "", | |
| 8 | + "license": "GPL-3.0", | |
| 9 | + "title": "CSB Zombie Classes", | |
| 10 | + "short_desc": "Class system for CSB Zombie Core: pick a class (Classic, Runner, Tank, Leaper, Hunter), saved in nVault and applied on infection.", | |
| 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,hamsandwich,cstrike,fun,nvault", | |
| 20 | + "install_notes": "1. Install CSB Zombie Core first\n2. Put csb_zombie_classes.amxx in addons/amxmodx/plugins/\n3. Add it to plugins.ini BELOW the core\n4. Change the map", | |
| 21 | + "known_conflicts": "Requires CSB Zombie Core. Do not run alongside another zombie class system.", | |
| 22 | + "cvars": [ | |
| 23 | + { | |
| 24 | + "name": "csb_zmclass_enabled", | |
| 25 | + "default": "1", | |
| 26 | + "description": "Master switch for the class system." | |
| 27 | + } | |
| 28 | + ], | |
| 29 | + "commands": [ | |
| 30 | + { | |
| 31 | + "name": "say /zclass", | |
| 32 | + "access": "", | |
| 33 | + "description": "Open the zombie class menu." | |
| 34 | + }, | |
| 35 | + { | |
| 36 | + "name": "say /class", | |
| 37 | + "access": "", | |
| 38 | + "description": "Alias for /zclass." | |
| 39 | + } | |
| 40 | + ], | |
| 41 | + "main": "addons/amxmodx/scripting/csb_zombie_classes.sma" | |
| 42 | +} | |
| 0 | 43 |









