Sunucu tanitimi

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit 4e8675c8bab322328b065ba87d0bb19200cc451f
4 changed files with 225 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2026-02-08)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Player Trails</strong> attaches a coloured streak to a player using the <code>TE_BEAMFOLLOW</code> temp entity, re-sent on a task so the trail keeps up as they move. Players pick a colour from a menu with <code>/trail</code> (VIP/shop gated), and trails are wiped on death and at round start so the map does not fill up with beams.</p><h2>Features</h2><ul><li><code>/trail</code> colour menu: eight colours plus Off.</li><li>VIP-gated behind an access flag.</li><li>Trail refreshed on a task and killed on death and round start.</li><li>No external models beyond the stock laser sprite.</li></ul><h2>Installation</h2><ol><li>Compile <code>csb_player_trails.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><p>The menu requires the <code>ADMIN_LEVEL_H</code> flag (<code>t</code>) by default.</p>
+184 -0 addons/amxmodx/scripting/csb_player_trails.sma A
@@ -0,0 +1,184 @@
1 +/*
2 + * CSB Player Trails
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Attaches a coloured beam-follow trail to a player. A colour is picked from a
6 + * menu (VIP/shop gated) and the TE_BEAMFOLLOW temp entity is re-sent on a task
7 + * so the trail persists as the player moves. Trails are cleared on death and at
8 + * round start so the arena does not fill up with streaks.
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 +
20 +new const PLUGIN[] = "CSB Player Trails"
21 +new const VERSION[] = "1.0.0"
22 +new const AUTHOR[] = "counter-strike-boost.com"
23 +
24 +#define ACCESS_FLAG ADMIN_LEVEL_H
25 +
26 +new const g_szColorName[][] = { "Off", "Red", "Green", "Blue", "Yellow", "Cyan", "Purple", "White" }
27 +new const g_iColor[][3] =
28 +{
29 + { 0, 0, 0 },
30 + { 255, 0, 0 },
31 + { 0, 255, 0 },
32 + { 40, 90, 255 },
33 + { 255, 255, 0 },
34 + { 0, 255, 255 },
35 + { 200, 0, 255 },
36 + { 255, 255, 255 }
37 +}
38 +
39 +new g_pEnabled
40 +new g_iTrailSpr
41 +new g_iChoice[33]
42 +
43 +public plugin_init()
44 +{
45 + register_plugin(PLUGIN, VERSION, AUTHOR)
46 +
47 + g_pEnabled = register_cvar("csb_trails_enabled", "1")
48 +
49 + register_clcmd("say /trail", "cmdMenu")
50 + register_clcmd("say_team /trail", "cmdMenu")
51 +
52 + register_event("DeathMsg", "eventDeath", "a", "1>0")
53 + register_logevent("eventRoundStart", 2, "1=Round_Start")
54 +
55 + set_task(1.0, "taskTrails", 0, _, _, "b")
56 +}
57 +
58 +public plugin_precache()
59 +{
60 + g_iTrailSpr = precache_model("sprites/laserbeam.spr")
61 +}
62 +
63 +public client_putinserver(id)
64 +{
65 + g_iChoice[id] = 0
66 +}
67 +
68 +bool:hasAccess(id)
69 +{
70 + return (get_user_flags(id) & ACCESS_FLAG) != 0
71 +}
72 +
73 +public cmdMenu(id)
74 +{
75 + if (!get_pcvar_num(g_pEnabled))
76 + return PLUGIN_HANDLED
77 +
78 + if (!hasAccess(id))
79 + {
80 + client_print(id, print_chat, "[CSB] Trails are a VIP feature.")
81 + return PLUGIN_HANDLED
82 + }
83 +
84 + new menu = menu_create("\yCSB Trail^n\wPick a colour:", "menuHandler")
85 +
86 + new info[8]
87 + for (new i = 0; i < sizeof(g_szColorName); i++)
88 + {
89 + num_to_str(i, info, charsmax(info))
90 + menu_additem(menu, g_szColorName[i], info, 0)
91 + }
92 +
93 + menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
94 + menu_display(id, menu, 0)
95 + return PLUGIN_HANDLED
96 +}
97 +
98 +public menuHandler(id, menu, item)
99 +{
100 + if (item == MENU_EXIT)
101 + {
102 + menu_destroy(menu)
103 + return PLUGIN_HANDLED
104 + }
105 +
106 + new info[8], name[32], access, callback
107 + menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback)
108 + menu_destroy(menu)
109 +
110 + g_iChoice[id] = clamp(str_to_num(info), 0, sizeof(g_szColorName) - 1)
111 +
112 + killTrail(id)
113 +
114 + if (g_iChoice[id] == 0)
115 + client_print(id, print_chat, "[CSB] Trail removed.")
116 + else
117 + {
118 + client_print(id, print_chat, "[CSB] Trail set to %s.", g_szColorName[g_iChoice[id]])
119 + if (is_user_alive(id))
120 + sendTrail(id)
121 + }
122 +
123 + return PLUGIN_HANDLED
124 +}
125 +
126 +public eventDeath()
127 +{
128 + new victim = read_data(2)
129 +
130 + if (victim >= 1 && victim <= 32)
131 + killTrail(victim)
132 +}
133 +
134 +public eventRoundStart()
135 +{
136 + new players[32], num
137 + get_players(players, num, "c")
138 +
139 + for (new i = 0; i < num; i++)
140 + killTrail(players[i])
141 +}
142 +
143 +sendTrail(id)
144 +{
145 + if (!is_user_alive(id) || g_iChoice[id] == 0)
146 + return
147 +
148 + new c = g_iChoice[id]
149 +
150 + message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
151 + write_byte(TE_BEAMFOLLOW)
152 + write_short(id)
153 + write_short(g_iTrailSpr)
154 + write_byte(20) /* life in 0.1s */
155 + write_byte(6) /* width */
156 + write_byte(g_iColor[c][0])
157 + write_byte(g_iColor[c][1])
158 + write_byte(g_iColor[c][2])
159 + write_byte(180) /* brightness */
160 + message_end()
161 +}
162 +
163 +killTrail(id)
164 +{
165 + /* a zero-life beam follow on the entity clears any active one */
166 + message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
167 + write_byte(TE_KILLBEAM)
168 + write_short(id)
169 + message_end()
170 +}
171 +
172 +public taskTrails()
173 +{
174 + new players[32], num
175 + get_players(players, num, "a")
176 +
177 + for (new i = 0; i < num; i++)
178 + {
179 + new id = players[i]
180 +
181 + if (g_iChoice[id] > 0)
182 + sendTrail(id)
183 + }
184 +}
+37 -0 csb.json A
@@ -0,0 +1,37 @@
1 +{
2 + "name": "CSB Player Trails",
3 + "category": "fun",
4 + "tags": "trails, beams, cosmetic",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Player Trails",
10 + "short_desc": "A coloured beam-follow trail behind a player, picked from a menu, VIP gated, and cleared on death and round start.",
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_player_trails.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n2. Change map",
21 + "known_conflicts": "Other plugins that spawn beam-follow effects on players may overlap visually.",
22 + "cvars": [
23 + {
24 + "name": "csb_trails_enabled",
25 + "default": "1",
26 + "description": "Enable or disable trails."
27 + }
28 + ],
29 + "commands": [
30 + {
31 + "name": "say /trail",
32 + "access": "t (ADMIN_LEVEL_H)",
33 + "description": "Open the trail colour menu (VIP)."
34 + }
35 + ],
36 + "main": "addons/amxmodx/scripting/csb_player_trails.sma"
37 +}
0 38