Unknown ❤ RESPAWN.ZAFEST.RO | VIP FREE | FREE FOR ALL ❤ 0/32
Romania XPlayZM.CSBlackDevil.COM # Zombie Plague UltimateX [ Respawn + FDL + VIP 22-12PM + POINTS] ® 12/32
Server bewerben

Add 2 tutorials (2 files)

Browse Source
Daemon666 committed parent 943a2484e8 commit 1bb686d738f74598547cbc37c61b1351d8780057
2 changed files with 146 additions and 0 deletions
+59 -0 fix-fastdl-not-working/en.md A
@@ -0,0 +1,59 @@
1 +---
2 +title: "Fix: FastDL Not Working - Players Still Download at 20 KB/s"
3 +excerpt: "Every reason FastDL falls back to the slow in-game download - sv_downloadurl, mirrored file layout, bzip2, MIME types and permissions - each with a concrete check."
4 +category: "errors"
5 +tags: "fastdl, downloads"
6 +image: ""
7 +read_time: "9 min read"
8 +---
9 +<p>FastDL exists so players pull maps and models over HTTP at real speed instead of the engine's crawling in-game transfer of roughly 20 KB/s. When it "does not work", players are silently falling back to that in-game path — which means the HTTP fetch failed and the engine quietly used the slow route. The fix is to find why the HTTP request 404s or is rejected, because that fallback hides the real error. Work through the layers from cvar to file to web server.</p>
10 +
11 +<h2>1. Confirm sv_downloadurl is set and correct</h2>
12 +<p>On the server console:</p>
13 +<pre>sv_downloadurl
14 +sv_allowdownload
15 +sv_allowupload</pre>
16 +<p><code>sv_downloadurl</code> must point at the <strong>base</strong> of your web-hosted <code>cstrike</code> mirror, and <code>sv_allowdownload</code> must be 1. A typical value:</p>
17 +<pre>sv_downloadurl "https://dl.example.com/cstrike/"
18 +sv_allowdownload 1</pre>
19 +<p>The engine appends the resource path to this URL. So a map <code>maps/de_rats.bsp</code> is fetched from <code>https://dl.example.com/cstrike/maps/de_rats.bsp</code>. If your base URL points at the wrong level, every fetch 404s and every player falls back to the slow download.</p>
20 +
21 +<h2>2. Mirror the exact directory layout</h2>
22 +<p>FastDL is a dumb file mirror — the paths must match the server's <code>cstrike</code> tree exactly. If the server needs <code>sound/misc/foo.wav</code>, the web server must serve it at <code>.../cstrike/sound/misc/foo.wav</code>. Case matters on Linux web servers. Lay it out identically:</p>
23 +<pre>cstrike/maps/de_rats.bsp
24 +cstrike/sound/misc/foo.wav
25 +cstrike/models/player/leet/leet.mdl
26 +cstrike/sprites/foo.spr
27 +cstrike/gfx/env/skybox.tga</pre>
28 +<p>Only files the client must download need mirroring — maps, and custom models/sounds/sprites referenced by <code>precache</code>. Standard game content the player already has does not.</p>
29 +
30 +<h2>3. bzip2 the files (the big one)</h2>
31 +<p>The engine will fetch a <code>.bz2</code> version of a resource if it exists, which is far smaller and faster. Most FastDL setups compress everything and serve the <code>.bz2</code> alongside the raw file. Compress in place, keeping both:</p>
32 +<pre>find cstrike -type f \( -name '*.bsp' -o -name '*.mdl' -o -name '*.wav' \
33 + -o -name '*.spr' -o -name '*.tga' \) -exec bzip2 -k {} \;</pre>
34 +<p>Now the mirror has both <code>de_rats.bsp</code> and <code>de_rats.bsp.bz2</code>. If your host only serves the uncompressed files, downloads still work but are slower and heavier — the missing <code>.bz2</code> is a common "it works but it's not fast" cause.</p>
35 +
36 +<h2>4. Fix MIME types and 404 handling</h2>
37 +<p>A web server that returns an HTML 404 page with a 200 status, or that refuses to serve <code>.bsp</code>/<code>.bz2</code> because it has no MIME type for them, breaks FastDL. Make the server return real 404s and serve these as generic binary. On Apache, in the mirror's <code>.htaccess</code> or vhost:</p>
38 +<pre>AddType application/octet-stream .bsp .bz2 .mdl .spr .wav .tga
39 +Options -Indexes</pre>
40 +<p>Test the URL yourself — this is the single most decisive check:</p>
41 +<pre>curl -I "https://dl.example.com/cstrike/maps/de_rats.bsp.bz2"</pre>
42 +<p>You must get <code>HTTP/1.1 200</code> and a sensible <code>Content-Type</code>. A <code>404</code>, a redirect to HTTPS/login, or an HTML body is exactly why players fall back to the slow download.</p>
43 +
44 +<h2>5. Permissions and HTTPS</h2>
45 +<p>The web server user must be able to read the files (<code>chmod 644</code>, directories <code>755</code>). And if <code>sv_downloadurl</code> uses <code>https://</code>, the certificate must be valid — some old clients and the 25th-Anniversary client handle a broken chain poorly. If in doubt, a plain <code>http://</code> mirror removes TLS from the equation while you debug.</p>
46 +
47 +<h2>Common errors</h2>
48 +<ul>
49 +<li><strong>Still ~20 KB/s for everyone</strong> — the HTTP fetch 404s. <code>curl -I</code> the exact resource URL; fix the base URL or the file path.</li>
50 +<li><strong>Works but slow</strong> — you are serving uncompressed files; add the <code>.bz2</code> variants.</li>
51 +<li><strong>Some files download, others don't</strong> — case-sensitivity or a missing MIME type on a specific extension. Linux paths are case-sensitive.</li>
52 +<li><strong>Downloads then "missing file" on the client</strong> — the mirrored file is truncated or the wrong version. Re-upload and re-compress it.</li>
53 +<li><strong>Nothing downloads at all</strong> — <code>sv_allowdownload</code> is 0. Check it first.</li>
54 +</ul>
55 +
56 +<h2>Verification</h2>
57 +<p>Connect a client to a map that requires a custom file and watch the download bar — FastDL is working when a map pulls in a second or two instead of grinding for a minute. Then confirm the server side by fetching a known resource directly:</p>
58 +<pre>curl -I "https://dl.example.com/cstrike/maps/de_rats.bsp.bz2"</pre>
59 +<p>A <code>200</code> here plus a fast in-game download means FastDL is live. If the query works but the client still crawls, double-check <code>sv_downloadurl</code> has no typo and the file the client needs actually exists at the mirrored path — the engine's silent fallback will otherwise keep hiding the 404 from you.</p>
+87 -0 vscode-amxx-setup/en.md A
@@ -0,0 +1,87 @@
1 +---
2 +title: "VS Code Setup for AMX Mod X (Syntax, Snippets, Build Task)"
3 +excerpt: "Turn VS Code into a real AMXX editor: Pawn syntax highlighting, include-aware navigation, and a build task that runs amxxpc and jumps to the failing line. Config included."
4 +category: "plugin-dev"
5 +tags: "vscode, tooling"
6 +image: ""
7 +read_time: "8 min read"
8 +---
9 +<p>Editing <code>.sma</code> files in Notepad is a needless handicap. VS Code gives you Pawn syntax highlighting, symbol navigation across the AMXX includes, and &mdash; the real win &mdash; a build task that runs <code>amxxpc</code> with a single shortcut and puts the compiler's errors directly in the Problems panel, clickable to the exact line. This is a one-time setup.</p>
10 +
11 +<h2>1. Install a Pawn / AMXX extension</h2>
12 +<p>Open the Extensions view (<code>Ctrl+Shift+X</code>) and search for <strong>AMXX Pawn</strong> or <strong>Pawn</strong>. Install an extension that provides Pawn language support &mdash; syntax highlighting, bracket matching, and ideally snippets for AMXX natives. There are community extensions dedicated to AMX Mod X Pawn; pick one with recent updates and a reasonable install count. If none suits you, a generic Pawn grammar still gives correct highlighting because AMXX Pawn shares the base syntax.</p>
13 +
14 +<h2>2. Point the editor at the AMXX includes</h2>
15 +<p>Symbol lookup and go-to-definition only work if the editor can see the <code>.inc</code> files. Open your plugin folder as a workspace and add the scripting include path to the workspace settings. Create <code>.vscode/settings.json</code>:</p>
16 +<pre>{
17 + "files.associations": {
18 + "*.sma": "pawn",
19 + "*.inc": "pawn"
20 + }
21 +}</pre>
22 +<p>Then either work directly inside <code>addons/amxmodx/scripting/</code> (so <code>include/</code> is present), or copy the <code>include/</code> folder next to your sources. Extensions that support an include-path setting will expose one &mdash; set it to the folder containing <code>amxmodx.inc</code>.</p>
23 +
24 +<h2>3. Create a build task that runs amxxpc</h2>
25 +<p>This is the part that makes VS Code worth it. Create <code>.vscode/tasks.json</code>. On Linux:</p>
26 +<pre>{
27 + "version": "2.0.0",
28 + "tasks": [
29 + {
30 + "label": "Compile AMXX",
31 + "type": "shell",
32 + "command": "./amxxpc",
33 + "args": [ "${file}" ],
34 + "options": {
35 + "cwd": "/home/steam/hlds/cstrike/addons/amxmodx/scripting"
36 + },
37 + "group": { "kind": "build", "isDefault": true },
38 + "problemMatcher": {
39 + "owner": "pawn",
40 + "fileLocation": [ "absolute" ],
41 + "pattern": {
42 + "regexp": "^(.*)\\((\\d+)\\) : (warning|error) \\d+: (.*)$",
43 + "file": 1, "line": 2, "severity": 3, "message": 4
44 + }
45 + }
46 + }
47 + ]
48 +}</pre>
49 +<p>On Windows, change <code>command</code> to <code>amxxpc.exe</code> and <code>cwd</code> to your Windows scripting path (for example <code>C:\\hlds\\cstrike\\addons\\amxmodx\\scripting</code>).</p>
50 +
51 +<h2>4. What the problemMatcher does</h2>
52 +<p><code>amxxpc</code> prints errors in the form <code>myplugin.sma(42) : error 017: undefined symbol "foo"</code>. The regex above parses that line into a filename, line number, severity, and message, so VS Code populates the Problems panel and underlines line&nbsp;42. Clicking the entry jumps straight there. That turns the compile-fix-recompile loop from copy-pasting line numbers into pressing one key.</p>
53 +
54 +<h2>5. Bind the build key</h2>
55 +<p>With the task set as <code>"isDefault": true</code>, press <code>Ctrl+Shift+B</code> to compile the open <code>.sma</code>. The compiler output appears in the integrated terminal and errors appear in Problems. No shell juggling, no leaving the editor.</p>
56 +
57 +<h2>6. Snippets (optional but worth it)</h2>
58 +<p>Add your own snippets for the boilerplate you type constantly. <em>File &rarr; Preferences &rarr; Configure Snippets &rarr; pawn</em>, then add:</p>
59 +<pre>{
60 + "plugin_init": {
61 + "prefix": "plugininit",
62 + "body": [
63 + "public plugin_init() {",
64 + "\tregister_plugin(\"$1\", \"1.0.0\", \"$2\")",
65 + "\t$0",
66 + "}"
67 + ]
68 + }
69 +}</pre>
70 +<p>Type <code>plugininit</code> and press Tab to expand the whole stub.</p>
71 +
72 +<h2>7. Editing on a remote server</h2>
73 +<p>If your sources live on a Linux game server rather than your PC, use the VS Code Remote&nbsp;-&nbsp;SSH extension to edit them in place. You open the remote <code>scripting/</code> folder as a workspace, and the exact same <code>tasks.json</code> runs <code>amxxpc</code> on the server itself &mdash; no uploading, no version-mismatch risk, because you are compiling with the server's own compiler against the server's own <code>include/</code>. The Problems panel still works over the SSH connection. This is the cleanest setup when you administer several remote servers: one editor, and each server compiles with its own toolchain.</p>
74 +
75 +<h2>8. Auto-install on successful build</h2>
76 +<p>You can chain the build task to copy the compiled plugin into <code>plugins/</code> so it is ready to <code>amxx reload</code>. Add a second task that depends on the compile and copies <code>compiled/${fileBasenameNoExtension}.amxx</code> into the plugins folder, then make that the default build task. Keep the copy step separate from the compile so a failed build never overwrites a working plugin &mdash; only a clean <code>Done.</code> should reach the live <code>plugins/</code> directory.</p>
77 +
78 +<h2>Common errors</h2>
79 +<ul>
80 +<li><strong>Build task does nothing / "command not found"</strong> &mdash; wrong <code>cwd</code>, or <code>amxxpc</code> is not executable. On Linux run <code>chmod +x amxxpc</code> and confirm the 32-bit runtime is installed (see <a href="/tutorials/compile-sma-to-amxx">compiling a .sma</a>).</li>
81 +<li><strong>Errors compile but do not appear in Problems</strong> &mdash; the <code>problemMatcher</code> regex does not match your compiler's output format; compile once in a terminal and adjust the regex to the exact line shape.</li>
82 +<li><strong>No syntax highlighting</strong> &mdash; the file is not associated with <code>pawn</code>; check <code>files.associations</code>.</li>
83 +<li><strong>Go-to-definition fails on natives</strong> &mdash; the include path is not set, so the editor cannot see <code>amxmodx.inc</code>.</li>
84 +</ul>
85 +
86 +<h2>Verification</h2>
87 +<p>Open a known-good <code>.sma</code>, press <code>Ctrl+Shift+B</code>, and confirm the terminal prints <code>Done.</code> and a <code>compiled/*.amxx</code> appears. Then introduce a deliberate error &mdash; delete a semicolon &mdash; rebuild, and check the Problems panel lists it and clicking jumps to the line. When both work, your edit-compile loop is complete; pair it with <a href="/tutorials/write-first-amxx-plugin">your first plugin</a> and iterate.</p>
0 88