Initial release 1.0.0
Browse Source1.0.0 - Initial release.
4 changed files
with 254 additions and 0 deletions
A
CHANGELOG.md
+3 -0
A
README.md
+1 -0
A
addons/amxmodx/scripting/csb_jetpack.sma
+188 -0
A
csb.json
+62 -0
CHANGELOG.md
A
| @@ -0,0 +1,3 @@ | ||
| 1 | +## 1.0.0 (2026-05-24) | |
| 2 | + | |
| 3 | +1.0.0 - Initial release. |
README.md
A
| @@ -0,0 +1 @@ | ||
| 1 | +<p><strong>CSB Jetpack</strong> gives players a jetpack on a key bind. While <code>+jetpack</code> is held the player is pushed along their aim direction (<code>velocity_by_aim</code>) with an upward lift, a thrust light burns at their feet and a fuel bar drains on the HUD. Standing on the ground refills the tank. Access can be locked behind an admin flag so it becomes a VIP perk.</p><p>Inspired by VEN's classic Jetpack plugin. Independent GPL re-implementation; no original code is reused.</p><h2>Features</h2><ul><li>Bind a key to <code>+jetpack</code>; hold to fly, release to stop.</li><li>Fuel bar shown on the HUD, draining in flight and regenerating on the ground.</li><li>Tunable thrust (<code>csb_jet_power</code>), lift, drain and regen rates.</li><li>Optional VIP gate via <code>csb_jet_flag</code>.</li></ul><h2>Installation</h2><ol><li>Compile <code>csb_jetpack.sma</code> and copy it to <code>addons/amxmodx/plugins/</code>.</li><li>Add it to <code>plugins.ini</code> and change the map.</li><li>Tell players to bind a key, e.g. <code>bind mouse2 +jetpack</code>.</li></ol> |
addons/amxmodx/scripting/csb_jetpack.sma
A
| @@ -0,0 +1,188 @@ | ||
| 1 | +/* | |
| 2 | + * CSB Jetpack | |
| 3 | + * Copyright (C) 2026 counter-strike-boost.com | |
| 4 | + * | |
| 5 | + * A fuel-limited jetpack. Bind a key to +jetpack: while held, the player is | |
| 6 | + * pushed along their aim direction with a little lift, a thrust light burns at | |
| 7 | + * their feet and the fuel bar drains. Standing on the ground refills the fuel. | |
| 8 | + * Access can be restricted to a flag so it becomes a VIP perk. | |
| 9 | + * | |
| 10 | + * Inspired by VEN's classic Jetpack plugin for AMX Mod X. This is an | |
| 11 | + * independent GPL re-implementation; no original code is reused. | |
| 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 <amxmisc> | |
| 23 | +#include <fakemeta> | |
| 24 | +#include <fun> | |
| 25 | + | |
| 26 | +new const PLUGIN[] = "CSB Jetpack" | |
| 27 | +new const VERSION[] = "1.0.0" | |
| 28 | +new const AUTHOR[] = "counter-strike-boost.com" | |
| 29 | + | |
| 30 | +#define SVC_TEMPENTITY 23 | |
| 31 | +#define TE_DLIGHT 27 | |
| 32 | +#define TASK_THINK 5500 | |
| 33 | + | |
| 34 | +new g_pEnabled, g_pPower, g_pLift, g_pDrain, g_pRegen, g_pAccess, g_pSound | |
| 35 | + | |
| 36 | +new bool:g_bThrust[33] | |
| 37 | +new Float:g_fFuel[33] | |
| 38 | +new g_szSound[64] | |
| 39 | +new g_iSyncHud | |
| 40 | + | |
| 41 | +public plugin_precache() | |
| 42 | +{ | |
| 43 | + g_pSound = register_cvar("csb_jet_sound", "") | |
| 44 | + get_pcvar_string(g_pSound, g_szSound, charsmax(g_szSound)) | |
| 45 | + | |
| 46 | + if (g_szSound[0]) | |
| 47 | + precache_sound(g_szSound) | |
| 48 | +} | |
| 49 | + | |
| 50 | +public plugin_init() | |
| 51 | +{ | |
| 52 | + register_plugin(PLUGIN, VERSION, AUTHOR) | |
| 53 | + | |
| 54 | + g_pEnabled = register_cvar("csb_jet_enabled", "1") | |
| 55 | + g_pPower = register_cvar("csb_jet_power", "320") // forward speed | |
| 56 | + g_pLift = register_cvar("csb_jet_lift", "170.0") // upward push | |
| 57 | + g_pDrain = register_cvar("csb_jet_drain", "1.5") // fuel per tick | |
| 58 | + g_pRegen = register_cvar("csb_jet_regen", "2.0") // fuel per tick on ground | |
| 59 | + g_pAccess = register_cvar("csb_jet_flag", "") // required admin flag(s), empty = everyone | |
| 60 | + | |
| 61 | + register_clcmd("+jetpack", "cmdThrustOn") | |
| 62 | + register_clcmd("-jetpack", "cmdThrustOff") | |
| 63 | + | |
| 64 | + g_iSyncHud = CreateHudSyncObj() | |
| 65 | + | |
| 66 | + set_task(0.1, "taskThink", TASK_THINK, _, _, "b") | |
| 67 | +} | |
| 68 | + | |
| 69 | +public client_putinserver(id) | |
| 70 | +{ | |
| 71 | + g_bThrust[id] = false | |
| 72 | + g_fFuel[id] = 100.0 | |
| 73 | +} | |
| 74 | + | |
| 75 | +public client_disconnected(id) | |
| 76 | +{ | |
| 77 | + g_bThrust[id] = false | |
| 78 | +} | |
| 79 | + | |
| 80 | +bool:hasAccess(id) | |
| 81 | +{ | |
| 82 | + new flags[8] | |
| 83 | + get_pcvar_string(g_pAccess, flags, charsmax(flags)) | |
| 84 | + | |
| 85 | + if (!flags[0]) | |
| 86 | + return true | |
| 87 | + | |
| 88 | + return (get_user_flags(id) & read_flags(flags)) ? true : false | |
| 89 | +} | |
| 90 | + | |
| 91 | +public cmdThrustOn(id) | |
| 92 | +{ | |
| 93 | + if (!get_pcvar_num(g_pEnabled)) | |
| 94 | + return PLUGIN_HANDLED | |
| 95 | + | |
| 96 | + if (!hasAccess(id)) | |
| 97 | + { | |
| 98 | + client_print(id, print_chat, "[CSB] The jetpack is reserved for VIP players.") | |
| 99 | + return PLUGIN_HANDLED | |
| 100 | + } | |
| 101 | + | |
| 102 | + g_bThrust[id] = true | |
| 103 | + return PLUGIN_HANDLED | |
| 104 | +} | |
| 105 | + | |
| 106 | +public cmdThrustOff(id) | |
| 107 | +{ | |
| 108 | + g_bThrust[id] = false | |
| 109 | + return PLUGIN_HANDLED | |
| 110 | +} | |
| 111 | + | |
| 112 | +public taskThink() | |
| 113 | +{ | |
| 114 | + new Float:power = float(get_pcvar_num(g_pPower)) | |
| 115 | + new Float:lift = get_pcvar_float(g_pLift) | |
| 116 | + new Float:drain = get_pcvar_float(g_pDrain) | |
| 117 | + new Float:regen = get_pcvar_float(g_pRegen) | |
| 118 | + | |
| 119 | + new players[32], num, pid, origin[3] | |
| 120 | + get_players(players, num, "a") | |
| 121 | + | |
| 122 | + for (new i = 0; i < num; i++) | |
| 123 | + { | |
| 124 | + pid = players[i] | |
| 125 | + | |
| 126 | + new bool:onGround = (pev(pid, pev_flags) & FL_ONGROUND) ? true : false | |
| 127 | + | |
| 128 | + if (g_bThrust[pid] && g_fFuel[pid] > 0.0 && get_pcvar_num(g_pEnabled)) | |
| 129 | + { | |
| 130 | + new Float:aim[3] | |
| 131 | + velocity_by_aim(pid, floatround(power), aim) | |
| 132 | + | |
| 133 | + new Float:vel[3] | |
| 134 | + pev(pid, pev_velocity, vel) | |
| 135 | + vel[0] = aim[0] | |
| 136 | + vel[1] = aim[1] | |
| 137 | + vel[2] = aim[2] + lift | |
| 138 | + set_pev(pid, pev_velocity, vel) | |
| 139 | + | |
| 140 | + g_fFuel[pid] -= drain | |
| 141 | + if (g_fFuel[pid] < 0.0) | |
| 142 | + g_fFuel[pid] = 0.0 | |
| 143 | + | |
| 144 | + /* thrust light at the feet */ | |
| 145 | + get_user_origin(pid, origin) | |
| 146 | + message_begin(MSG_BROADCAST, SVC_TEMPENTITY) | |
| 147 | + write_byte(TE_DLIGHT) | |
| 148 | + write_coord(origin[0]) | |
| 149 | + write_coord(origin[1]) | |
| 150 | + write_coord(origin[2] - 20) | |
| 151 | + write_byte(6) | |
| 152 | + write_byte(255) | |
| 153 | + write_byte(random_num(120, 200)) | |
| 154 | + write_byte(0) | |
| 155 | + write_byte(2) | |
| 156 | + write_byte(4) | |
| 157 | + message_end() | |
| 158 | + | |
| 159 | + if (g_szSound[0]) | |
| 160 | + emit_sound(pid, CHAN_STATIC, g_szSound, 0.4, ATTN_NORM, 0, PITCH_NORM) | |
| 161 | + } | |
| 162 | + else if (onGround && g_fFuel[pid] < 100.0) | |
| 163 | + { | |
| 164 | + g_fFuel[pid] += regen | |
| 165 | + if (g_fFuel[pid] > 100.0) | |
| 166 | + g_fFuel[pid] = 100.0 | |
| 167 | + } | |
| 168 | + | |
| 169 | + showFuel(pid) | |
| 170 | + } | |
| 171 | +} | |
| 172 | + | |
| 173 | +showFuel(id) | |
| 174 | +{ | |
| 175 | + /* only bother while flying or when the tank is not full */ | |
| 176 | + if (!g_bThrust[id] && g_fFuel[id] >= 100.0) | |
| 177 | + return | |
| 178 | + | |
| 179 | + new pct = floatround(g_fFuel[id]) | |
| 180 | + new bar[11], filled = pct / 10 | |
| 181 | + | |
| 182 | + for (new i = 0; i < 10; i++) | |
| 183 | + bar[i] = (i < filled) ? '|' : '.' | |
| 184 | + bar[10] = 0 | |
| 185 | + | |
| 186 | + set_hudmessage(0, 180, 255, 0.02, 0.85, 0, 0.0, 0.3, 0.0, 0.0, -1) | |
| 187 | + ShowSyncHudMsg(id, g_iSyncHud, "Jetpack [%s] %d%%", bar, pct) | |
| 188 | +} |
csb.json
A
| @@ -0,0 +1,62 @@ | ||
| 1 | +{ | |
| 2 | + "name": "CSB Jetpack", | |
| 3 | + "category": "fun", | |
| 4 | + "tags": "jetpack, fly, fun", | |
| 5 | + "image": "", | |
| 6 | + "original_author": "VEN (Jetpack)", | |
| 7 | + "original_url": "", | |
| 8 | + "license": "GPL-3.0", | |
| 9 | + "title": "CSB Jetpack", | |
| 10 | + "short_desc": "A fuel-limited jetpack: hold +jetpack to fly along your aim with lift and a thrust light, drain a fuel bar, and refill it on the ground. Access can be flag-restricted.", | |
| 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. Put csb_jetpack.amxx in addons/amxmodx/plugins/\n2. Add it to addons/amxmodx/configs/plugins.ini\n3. Change map\n4. Players bind a key: bind mouse2 +jetpack", | |
| 21 | + "known_conflicts": "Other plugins that overwrite player velocity every frame (some gravity/no-clip mods) can fight the jetpack for control.", | |
| 22 | + "cvars": [ | |
| 23 | + { | |
| 24 | + "name": "csb_jet_enabled", | |
| 25 | + "default": "1", | |
| 26 | + "description": "Master enable for the jetpack." | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "name": "csb_jet_power", | |
| 30 | + "default": "320", | |
| 31 | + "description": "Forward thrust speed." | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "name": "csb_jet_lift", | |
| 35 | + "default": "170.0", | |
| 36 | + "description": "Upward push while thrusting." | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + "name": "csb_jet_drain", | |
| 40 | + "default": "1.5", | |
| 41 | + "description": "Fuel consumed per 0.1s tick in flight." | |
| 42 | + }, | |
| 43 | + { | |
| 44 | + "name": "csb_jet_regen", | |
| 45 | + "default": "2.0", | |
| 46 | + "description": "Fuel regained per 0.1s tick on the ground." | |
| 47 | + }, | |
| 48 | + { | |
| 49 | + "name": "csb_jet_flag", | |
| 50 | + "default": "", | |
| 51 | + "description": "Required admin flag(s) to use the jetpack (empty = everyone)." | |
| 52 | + } | |
| 53 | + ], | |
| 54 | + "commands": [ | |
| 55 | + { | |
| 56 | + "name": "+jetpack", | |
| 57 | + "access": "", | |
| 58 | + "description": "Hold to fire the jetpack (bind a key to it)." | |
| 59 | + } | |
| 60 | + ], | |
| 61 | + "main": "addons/amxmodx/scripting/csb_jetpack.sma" | |
| 62 | +} | |
| 0 | 63 |









