Promoveaza serverul
Black Friday Se termina in 50% reducere la un loc in Master Server si la lista Client, care vine cu PREMIUM PE VIATA
01 Zile 02 Ore 01 Min 40 Sec
Vezi ofertele

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit 9b790d55a3ffbcf2917c4638fe6bdfd1ffe453fa
4 changed files with 183 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2025-09-03)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Low Gravity Event</strong> keeps public rounds fresh. At each round start there is a configurable chance to drop <code>sv_gravity</code> for the whole round; it is announced in chat, shown on the HUD, and the server's normal gravity is restored the moment the round ends. Admins can force one on demand with <code>amx_lowgrav</code>.</p><h2>Features</h2><ul><li>Chance-based low-gravity rounds via <code>csb_lowgrav_chance</code>.</li><li>Gravity value is a cvar (<code>csb_lowgrav_value</code>).</li><li>Saves and restores the real <code>sv_gravity</code> so nothing is left changed.</li><li><code>amx_lowgrav</code> forces a low-gravity round (admin level <code>a</code>).</li></ul><h2>Installation</h2><ol><li>Compile <code>csb_low_gravity_event.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>
+132 -0 addons/amxmodx/scripting/csb_low_gravity_event.sma A
@@ -0,0 +1,132 @@
1 +/*
2 + * CSB Low Gravity Event
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Randomly (or by admin command) turns a round into a low-gravity round: at
6 + * round start there is a configurable chance to lower sv_gravity for the whole
7 + * round, announced in chat with a HUD indicator, and the original gravity is
8 + * restored when the round ends.
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 +
21 +new const PLUGIN[] = "CSB Low Gravity Event"
22 +new const VERSION[] = "1.0.0"
23 +new const AUTHOR[] = "counter-strike-boost.com"
24 +
25 +new g_pEnabled, g_pChance, g_pGravity
26 +new g_pGravityCvar
27 +
28 +new bool:g_bActive
29 +new g_iNormalGravity
30 +new g_iHudSync
31 +
32 +public plugin_init()
33 +{
34 + register_plugin(PLUGIN, VERSION, AUTHOR)
35 +
36 + g_pEnabled = register_cvar("csb_lowgrav_enabled", "1")
37 + g_pChance = register_cvar("csb_lowgrav_chance", "20")
38 + g_pGravity = register_cvar("csb_lowgrav_value", "300")
39 +
40 + g_pGravityCvar = get_cvar_pointer("sv_gravity")
41 +
42 + register_logevent("eventRoundStart", 2, "1=Round_Start")
43 + register_logevent("eventRoundEnd", 2, "1=Round_End")
44 +
45 + register_concmd("amx_lowgrav", "cmdForce", ADMIN_LEVEL_A, "- force a low gravity round now")
46 +
47 + g_iHudSync = CreateHudSyncObj()
48 +}
49 +
50 +public eventRoundStart()
51 +{
52 + if (!get_pcvar_num(g_pEnabled))
53 + return
54 +
55 + if (g_bActive)
56 + return
57 +
58 + if (random_num(1, 100) <= get_pcvar_num(g_pChance))
59 + startLowGravity()
60 +}
61 +
62 +startLowGravity()
63 +{
64 + if (g_bActive)
65 + return
66 +
67 + g_iNormalGravity = get_pcvar_num(g_pGravityCvar)
68 +
69 + if (g_iNormalGravity <= 0)
70 + g_iNormalGravity = 800
71 +
72 + set_pcvar_num(g_pGravityCvar, get_pcvar_num(g_pGravity))
73 +
74 + g_bActive = true
75 +
76 + client_print(0, print_chat, "[CSB] LOW GRAVITY ROUND! Jump high!")
77 +
78 + set_hudmessage(0, 200, 255, -1.0, 0.15, 0, 0.0, 4.0, 0.1, 0.5, -1)
79 + ShowSyncHudMsg(0, g_iHudSync, "LOW GRAVITY ROUND")
80 +
81 + set_task(4.0, "taskReminder", 918273)
82 +}
83 +
84 +public taskReminder()
85 +{
86 + if (!g_bActive)
87 + return
88 +
89 + set_hudmessage(0, 200, 255, 0.02, 0.30, 0, 0.0, 3.0, 0.1, 0.5, -1)
90 + ShowSyncHudMsg(0, g_iHudSync, "* low gravity active *")
91 +}
92 +
93 +public eventRoundEnd()
94 +{
95 + endLowGravity()
96 +}
97 +
98 +endLowGravity()
99 +{
100 + if (!g_bActive)
101 + return
102 +
103 + set_pcvar_num(g_pGravityCvar, g_iNormalGravity)
104 + g_bActive = false
105 +
106 + remove_task(918273)
107 +}
108 +
109 +public cmdForce(id, level, cid)
110 +{
111 + if (!cmd_access(id, level, cid, 1))
112 + return PLUGIN_HANDLED
113 +
114 + if (g_bActive)
115 + {
116 + client_print(id, print_chat, "[CSB] A low gravity round is already active.")
117 + return PLUGIN_HANDLED
118 + }
119 +
120 + startLowGravity()
121 +
122 + new name[32]
123 + get_user_name(id, name, charsmax(name))
124 + client_print(0, print_chat, "[CSB] %s started a low gravity round.", name)
125 + return PLUGIN_HANDLED
126 +}
127 +
128 +public plugin_end()
129 +{
130 + if (g_bActive)
131 + set_pcvar_num(g_pGravityCvar, g_iNormalGravity)
132 +}
+47 -0 csb.json A
@@ -0,0 +1,47 @@
1 +{
2 + "name": "CSB Low Gravity Event",
3 + "category": "fun",
4 + "tags": "gravity, event, fun",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Low Gravity Event",
10 + "short_desc": "Randomly turns a round into a low-gravity round with an announcement and HUD indicator, restoring gravity at round end.",
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": "",
20 + "install_notes": "1. Put csb_low_gravity_event.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n2. Change map",
21 + "known_conflicts": "Other plugins that change sv_gravity per round may fight over the value.",
22 + "cvars": [
23 + {
24 + "name": "csb_lowgrav_enabled",
25 + "default": "1",
26 + "description": "Enable or disable random low gravity rounds."
27 + },
28 + {
29 + "name": "csb_lowgrav_chance",
30 + "default": "20",
31 + "description": "Percent chance per round for a low gravity round."
32 + },
33 + {
34 + "name": "csb_lowgrav_value",
35 + "default": "300",
36 + "description": "sv_gravity value used during the event."
37 + }
38 + ],
39 + "commands": [
40 + {
41 + "name": "amx_lowgrav",
42 + "access": "a (ADMIN_LEVEL_A)",
43 + "description": "Force a low gravity round immediately."
44 + }
45 + ],
46 + "main": "addons/amxmodx/scripting/csb_low_gravity_event.sma"
47 +}
0 48