<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[open.mp forum - Plugins]]></title>
		<link>https://forum.open.mp/</link>
		<description><![CDATA[open.mp forum - https://forum.open.mp]]></description>
		<pubDate>Mon, 15 Jun 2026 07:57:08 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[[VoiceChat] omp-voice]]></title>
			<link>https://forum.open.mp/showthread.php?tid=4288</link>
			<pubDate>Sat, 13 Jun 2026 18:15:23 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=5142">ionuzcostin</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=4288</guid>
			<description><![CDATA[[RELEASE] omp-voice — Proximity + Radio/Phone Voice Chat for open.mp &amp; SA-MP 0.3.7<br />
<hr class="mycode_hr" />
What is omp-voice?<br />
<span style="font-weight: bold;" class="mycode_b">omp-voice</span> is a full-featured, server-authoritative voice chat system for <span style="font-weight: bold;" class="mycode_b">open.mp</span> and <span style="font-weight: bold;" class="mycode_b">SA-MP 0.3.7 R5</span>. It brings <span style="font-weight: bold;" class="mycode_b">proximity voice</span>, <span style="font-weight: bold;" class="mycode_b">radio channels</span>, and <span style="font-weight: bold;" class="mycode_b">phone calls</span> to your server — all encrypted, low-latency, and scriptable via Pawn.<br />
GitHub: <a href="https://github.com/staark-dev/omp-voice" target="_blank" rel="noopener" class="mycode_url">https://github.com/staark-dev/omp-voice</a><br />
<hr class="mycode_hr" />
Features<br />
🎙️ Proximity Voice<ul class="mycode_list"><li>Hear nearby players in <span style="font-weight: bold;" class="mycode_b">3D audio</span> with logarithmic distance falloff and stereo panning<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Occlusion</span> support — voices are muffled through walls and closed vehicles<br />
</li>
<li>Three preset ranges: <span style="font-weight: bold;" class="mycode_b">Whisper / Normal / Shout</span>, or a custom range per player<br />
</li>
<li>Interior and virtual-world gating (you only hear players in the same dimension)<br />
</li>
</ul>
📻 Radio &amp; Phone Channels<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Radio filter</span>: bandpass + squelch + half-duplex garble for that authentic feel<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Phone filter</span>: narrowband colouring for realistic call audio<br />
</li>
<li>Mixed <span style="font-weight: bold;" class="mycode_b">per-listener</span> on the server for perfect control<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Speakerphone</span> (<br />
/vspeaker<br />
) — let bystanders hear a phone call out loud<br />
</li>
</ul>
🔒 Security<ul class="mycode_list"><li>Per-connect <span style="font-weight: bold;" class="mycode_b">cryptographic token</span> identity (not IP-based)<br />
</li>
<li>Every relay↔client datagram sealed with <span style="font-weight: bold;" class="mycode_b">XChaCha20-Poly1305</span> AEAD encryption<br />
</li>
<li>Server is fully authoritative for position, flags, and channels — anti-spoof<br />
</li>
</ul>
🎧 Audio Quality<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Opus codec</span> — industry-standard, low-latency voice compression<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">RNNoise</span> neural noise suppression (enable/disable per client)<br />
</li>
<li>Adaptive jitter buffer for smooth playback<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Push-to-Talk</span> or <span style="font-weight: bold;" class="mycode_b">Voice Activation</span> modes (exclusive per client)<br />
</li>
</ul>
🖥️ In-Game Client UI (ImGui)<ul class="mycode_list"><li>Press <span style="font-weight: bold;" class="mycode_b">INSERT</span> to open the control panel: volumes, devices, PTT key rebind, noise suppression<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">"Who's talking" HUD</span> (toggle with F8) — see active speakers on-screen<br />
</li>
<li>Optional <span style="font-weight: bold;" class="mycode_b">floating labels</span> above player heads while they talk<br />
</li>
<li>Per-player local mute and volume control<br />
</li>
</ul>
<hr class="mycode_hr" />
Architecture<br />
omp-voice uses a <span style="font-weight: bold;" class="mycode_b">hybrid mixing model</span>:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Proximity</span> audio is relayed per-speaker as raw Opus; the client spatialises it locally (lowest latency)<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Radio/Phone buses</span> are decoded, filtered, and mixed <span style="font-weight: bold;" class="mycode_b">server-side per listener</span>, then re-encoded and streamed<br />
</li>
</ul>
The system consists of six modules:<br />
Module<br />
Roleshared/<br />
Wire protocol, crypto (libsodium), INI, UDP<br />
core/<br />
Routing engine: proximity, bus router, channels, mix policy<br />
relay/<br />
Standalone relay process — AEAD transport shell<br />
samp/<br />
SA-MP 0.3.7 plugin bridge (Pawn natives)<br />
omp/<br />
open.mp component bridge<br />
client/<br />
Windows <br />
.asi<br />
— WASAPI, Opus, RNNoise, ImGui panel<br />
<hr class="mycode_hr" />
Installation<br />
Server Side<br />
<ol type="1" class="mycode_list"><li>Drop <br />
plugins/VoiceChat.dll<br />
 (SA-MP) or the open.mp component into <br />
components/<br />
</li>
<li>Place <br />
voice_relay.exe<br />
 alongside the server executable<br />
</li>
<li>Copy <br />
qawno/include/voicechat.inc<br />
 (+ <br />
voicechat_ui.inc<br />
) for your gamemode<br />
</li>
<li>Add <br />
voice.ini<br />
 (config file — annotated, comes with the release)<br />
</li>
<li>Add to <br />
config.json<br />
: <br />
"legacy_plugins": ["VoiceChat"]<br />
 or to <br />
server.cfg<br />
 for SA-MP<br />
</li>
</ol>
Client Side (each player)<br />
<ol type="1" class="mycode_list"><li>Place <br />
VoiceChat.asi<br />
 in the GTA SA folder (requires an ASI loader: SilentPatch, CLEO, etc.)<br />
</li>
<li>Edit <br />
voicechat.ini<br />
 — set <br />
relay_ip<br />
 to the server's IP address<br />
</li>
</ol>
Firewall<br />
Open <span style="font-weight: bold;" class="mycode_b">UDP port 7779</span> inbound on your server:<br />
# Windows (admin)<br />
netsh advfirewall firewall add rule name="VoiceChat 7779" dir=in action=allow protocol=UDP localport=7779<br />
<br />
# Linux<br />
sudo ufw allow 7779/udp<br />
<br />
<hr class="mycode_hr" />
Pawn API (quick overview)<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;voicechat&gt;<br />
#include &lt;voicechat_ui&gt;<br />
<br />
public OnGameModeInit() {<br />
    gProximity = Voice_CreateChannel(VOICE_FILTER_NONE, false);<br />
    return 1;<br />
}<br />
<br />
public OnPlayerConnect(playerid) {<br />
    new ip[16]; GetPlayerIp(playerid, ip, sizeof ip);<br />
    Voice_OnPlayerConnect(playerid, ip);<br />
    Voice_AddToChannel(playerid, gProximity);<br />
    Voice_SetPlayerRange(playerid, VOICE_RANGE_NORMAL);<br />
    return 1;<br />
}<br />
<br />
public OnPlayerUpdate(playerid) {<br />
    new Float:x, Float:y, Float:z;<br />
    GetPlayerPos(playerid, x, y, z);<br />
    new veh = GetPlayerVehicleID(playerid) ? VOICE_VEH_CLOSED : VOICE_ONFOOT;<br />
    Voice_UpdatePosition(playerid, x, y, z,<br />
        GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid), veh);<br />
    return 1;<br />
}<br />
<br />
public OnPlayerStartTalking(playerid) { VoiceUI_OnStartTalking(playerid); return 1; }<br />
public OnPlayerStopTalking(playerid)  { VoiceUI_OnStopTalking(playerid);  return 1; }<br />
public OnPlayerDisconnect(playerid, reason) {<br />
    Voice_OnPlayerDisconnect(playerid);<br />
    return 1;<br />
}<br />
<br />
Key Natives<br />
// Channel management<br />
Voice_CreateChannel(filter, bool:positional, priority = 100);<br />
Voice_AddToChannel(playerid, channelid);<br />
Voice_RemoveFromChannel(playerid, channelid);<br />
<br />
// Player control<br />
Voice_SetPlayerRange(playerid, preset, Float:override = 0.0);<br />
Voice_SetPlayerFlags(playerid, bool:muted, bool:deafen, bool:alive, bool:spectator);<br />
Voice_SetMixPolicy(playerid, policy, Float:duckLevel = 0.5, Float:proximityFloor = 0.25);<br />
Voice_MutePlayer(playerid, targetid, bool:mute = true);  // per-pair mute<br />
Voice_SetSpeakerphone(playerid, bool:on = true);<br />
<br />
// Lifecycle<br />
Voice_OnPlayerConnect(playerid, const ip[]);<br />
Voice_OnPlayerDisconnect(playerid);<br />
Voice_ReloadConfig();  // reload voice.ini at runtime</code></div></div><br />
<br />
<hr class="mycode_hr" />
In-Game Controls (Client)<br />
Key Action:<br />
<span style="font-weight: bold;" class="mycode_b">B </span>Proximity push-to-talk<br />
<span style="font-weight: bold;" class="mycode_b">N </span>Radio/phone push-to-talk<br />
<span style="font-weight: bold;" class="mycode_b">F9 </span>Self-mute<br />
<span style="font-weight: bold;" class="mycode_b">F8 </span>Toggle "who's talking" HUD<br />
<span style="font-weight: bold;" class="mycode_b">INSERT </span>Open settings panel<br />
<br />
All keys are rebindable in the in-game panel.<br />
<hr class="mycode_hr" />
Building from Source<br />
<span style="font-weight: bold;" class="mycode_b">One-shot Windows build:</span><br />
powershell -ExecutionPolicy Bypass -File .\build.ps1<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Manual CMake (production config, x86):</span><br />
cmake -S . -B build -A Win32 -DVC_NO_SODIUM=OFF -DVC_WITH_OPUS=ON -DVC_BUILD_CLIENT=ON<br />
cmake --build build --config Release<br />
<br />
All third-party dependencies (libsodium, Opus, Dear ImGui, MinHook, RNNoise) are fetched and built automatically by CMake — no manual installs needed.<br />
CI/CD via GitHub Actions builds and tests on every push. Tagged releases (v*) publish ready-to-use bundles automatically.<br />
<hr class="mycode_hr" />
Current Status<br />
Core engine and all major features are implemented and validated in-game (2-player proximity with occlusion + falloff, radio/phone channels, speakerphone, RNNoise, ImGui panel).<br />
<span style="font-weight: bold;" class="mycode_b">Remaining / planned:</span><ul class="mycode_list"><li>AEC (Acoustic Echo Cancellation) — deferred; headphones avoid the issue for now<br />
</li>
<li>Linux 32-bit.so for SA-MP (relay and open.mp component already build on Linux x64)<br />
</li>
</ul>
<hr class="mycode_hr" />
Download<br />
👉 <span style="font-weight: bold;" class="mycode_b">GitHub Releases:</span> <a href="https://github.com/staark-dev/omp-voice/releases" target="_blank" rel="noopener" class="mycode_url">https://github.com/staark-dev/omp-voice/releases</a><br />
<br />
Bundles available:<ul class="mycode_list"><li>voicechat-client-win32.zip<br />
 — client.asi + voicechat.ini<br />
</li>
<li>voicechat-server-win.zip<br />
 — server plugin + relay + includes + voice.ini<br />
</li>
<li>voicechat-relay-linux-x64.tar.gz<br />
 — relay binary for Linux servers<br />
</li>
</ul>
Each bundle includes an <br />
INSTALL.txt.<br />
<hr class="mycode_hr" />
License<br />
MIT — free to use, modify, and distribute. See <a href="https://github.com/staark-dev/omp-voice/blob/main/LICENSE" target="_blank" rel="noopener" class="mycode_url">LICENSE</a>.<br />
<hr class="mycode_hr" />
<span style="font-style: italic;" class="mycode_i">Feedback, bug reports, and pull requests are welcome on GitHub!</span>]]></description>
			<content:encoded><![CDATA[[RELEASE] omp-voice — Proximity + Radio/Phone Voice Chat for open.mp &amp; SA-MP 0.3.7<br />
<hr class="mycode_hr" />
What is omp-voice?<br />
<span style="font-weight: bold;" class="mycode_b">omp-voice</span> is a full-featured, server-authoritative voice chat system for <span style="font-weight: bold;" class="mycode_b">open.mp</span> and <span style="font-weight: bold;" class="mycode_b">SA-MP 0.3.7 R5</span>. It brings <span style="font-weight: bold;" class="mycode_b">proximity voice</span>, <span style="font-weight: bold;" class="mycode_b">radio channels</span>, and <span style="font-weight: bold;" class="mycode_b">phone calls</span> to your server — all encrypted, low-latency, and scriptable via Pawn.<br />
GitHub: <a href="https://github.com/staark-dev/omp-voice" target="_blank" rel="noopener" class="mycode_url">https://github.com/staark-dev/omp-voice</a><br />
<hr class="mycode_hr" />
Features<br />
🎙️ Proximity Voice<ul class="mycode_list"><li>Hear nearby players in <span style="font-weight: bold;" class="mycode_b">3D audio</span> with logarithmic distance falloff and stereo panning<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Occlusion</span> support — voices are muffled through walls and closed vehicles<br />
</li>
<li>Three preset ranges: <span style="font-weight: bold;" class="mycode_b">Whisper / Normal / Shout</span>, or a custom range per player<br />
</li>
<li>Interior and virtual-world gating (you only hear players in the same dimension)<br />
</li>
</ul>
📻 Radio &amp; Phone Channels<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Radio filter</span>: bandpass + squelch + half-duplex garble for that authentic feel<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Phone filter</span>: narrowband colouring for realistic call audio<br />
</li>
<li>Mixed <span style="font-weight: bold;" class="mycode_b">per-listener</span> on the server for perfect control<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Speakerphone</span> (<br />
/vspeaker<br />
) — let bystanders hear a phone call out loud<br />
</li>
</ul>
🔒 Security<ul class="mycode_list"><li>Per-connect <span style="font-weight: bold;" class="mycode_b">cryptographic token</span> identity (not IP-based)<br />
</li>
<li>Every relay↔client datagram sealed with <span style="font-weight: bold;" class="mycode_b">XChaCha20-Poly1305</span> AEAD encryption<br />
</li>
<li>Server is fully authoritative for position, flags, and channels — anti-spoof<br />
</li>
</ul>
🎧 Audio Quality<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Opus codec</span> — industry-standard, low-latency voice compression<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">RNNoise</span> neural noise suppression (enable/disable per client)<br />
</li>
<li>Adaptive jitter buffer for smooth playback<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Push-to-Talk</span> or <span style="font-weight: bold;" class="mycode_b">Voice Activation</span> modes (exclusive per client)<br />
</li>
</ul>
🖥️ In-Game Client UI (ImGui)<ul class="mycode_list"><li>Press <span style="font-weight: bold;" class="mycode_b">INSERT</span> to open the control panel: volumes, devices, PTT key rebind, noise suppression<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">"Who's talking" HUD</span> (toggle with F8) — see active speakers on-screen<br />
</li>
<li>Optional <span style="font-weight: bold;" class="mycode_b">floating labels</span> above player heads while they talk<br />
</li>
<li>Per-player local mute and volume control<br />
</li>
</ul>
<hr class="mycode_hr" />
Architecture<br />
omp-voice uses a <span style="font-weight: bold;" class="mycode_b">hybrid mixing model</span>:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Proximity</span> audio is relayed per-speaker as raw Opus; the client spatialises it locally (lowest latency)<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Radio/Phone buses</span> are decoded, filtered, and mixed <span style="font-weight: bold;" class="mycode_b">server-side per listener</span>, then re-encoded and streamed<br />
</li>
</ul>
The system consists of six modules:<br />
Module<br />
Roleshared/<br />
Wire protocol, crypto (libsodium), INI, UDP<br />
core/<br />
Routing engine: proximity, bus router, channels, mix policy<br />
relay/<br />
Standalone relay process — AEAD transport shell<br />
samp/<br />
SA-MP 0.3.7 plugin bridge (Pawn natives)<br />
omp/<br />
open.mp component bridge<br />
client/<br />
Windows <br />
.asi<br />
— WASAPI, Opus, RNNoise, ImGui panel<br />
<hr class="mycode_hr" />
Installation<br />
Server Side<br />
<ol type="1" class="mycode_list"><li>Drop <br />
plugins/VoiceChat.dll<br />
 (SA-MP) or the open.mp component into <br />
components/<br />
</li>
<li>Place <br />
voice_relay.exe<br />
 alongside the server executable<br />
</li>
<li>Copy <br />
qawno/include/voicechat.inc<br />
 (+ <br />
voicechat_ui.inc<br />
) for your gamemode<br />
</li>
<li>Add <br />
voice.ini<br />
 (config file — annotated, comes with the release)<br />
</li>
<li>Add to <br />
config.json<br />
: <br />
"legacy_plugins": ["VoiceChat"]<br />
 or to <br />
server.cfg<br />
 for SA-MP<br />
</li>
</ol>
Client Side (each player)<br />
<ol type="1" class="mycode_list"><li>Place <br />
VoiceChat.asi<br />
 in the GTA SA folder (requires an ASI loader: SilentPatch, CLEO, etc.)<br />
</li>
<li>Edit <br />
voicechat.ini<br />
 — set <br />
relay_ip<br />
 to the server's IP address<br />
</li>
</ol>
Firewall<br />
Open <span style="font-weight: bold;" class="mycode_b">UDP port 7779</span> inbound on your server:<br />
# Windows (admin)<br />
netsh advfirewall firewall add rule name="VoiceChat 7779" dir=in action=allow protocol=UDP localport=7779<br />
<br />
# Linux<br />
sudo ufw allow 7779/udp<br />
<br />
<hr class="mycode_hr" />
Pawn API (quick overview)<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;voicechat&gt;<br />
#include &lt;voicechat_ui&gt;<br />
<br />
public OnGameModeInit() {<br />
    gProximity = Voice_CreateChannel(VOICE_FILTER_NONE, false);<br />
    return 1;<br />
}<br />
<br />
public OnPlayerConnect(playerid) {<br />
    new ip[16]; GetPlayerIp(playerid, ip, sizeof ip);<br />
    Voice_OnPlayerConnect(playerid, ip);<br />
    Voice_AddToChannel(playerid, gProximity);<br />
    Voice_SetPlayerRange(playerid, VOICE_RANGE_NORMAL);<br />
    return 1;<br />
}<br />
<br />
public OnPlayerUpdate(playerid) {<br />
    new Float:x, Float:y, Float:z;<br />
    GetPlayerPos(playerid, x, y, z);<br />
    new veh = GetPlayerVehicleID(playerid) ? VOICE_VEH_CLOSED : VOICE_ONFOOT;<br />
    Voice_UpdatePosition(playerid, x, y, z,<br />
        GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid), veh);<br />
    return 1;<br />
}<br />
<br />
public OnPlayerStartTalking(playerid) { VoiceUI_OnStartTalking(playerid); return 1; }<br />
public OnPlayerStopTalking(playerid)  { VoiceUI_OnStopTalking(playerid);  return 1; }<br />
public OnPlayerDisconnect(playerid, reason) {<br />
    Voice_OnPlayerDisconnect(playerid);<br />
    return 1;<br />
}<br />
<br />
Key Natives<br />
// Channel management<br />
Voice_CreateChannel(filter, bool:positional, priority = 100);<br />
Voice_AddToChannel(playerid, channelid);<br />
Voice_RemoveFromChannel(playerid, channelid);<br />
<br />
// Player control<br />
Voice_SetPlayerRange(playerid, preset, Float:override = 0.0);<br />
Voice_SetPlayerFlags(playerid, bool:muted, bool:deafen, bool:alive, bool:spectator);<br />
Voice_SetMixPolicy(playerid, policy, Float:duckLevel = 0.5, Float:proximityFloor = 0.25);<br />
Voice_MutePlayer(playerid, targetid, bool:mute = true);  // per-pair mute<br />
Voice_SetSpeakerphone(playerid, bool:on = true);<br />
<br />
// Lifecycle<br />
Voice_OnPlayerConnect(playerid, const ip[]);<br />
Voice_OnPlayerDisconnect(playerid);<br />
Voice_ReloadConfig();  // reload voice.ini at runtime</code></div></div><br />
<br />
<hr class="mycode_hr" />
In-Game Controls (Client)<br />
Key Action:<br />
<span style="font-weight: bold;" class="mycode_b">B </span>Proximity push-to-talk<br />
<span style="font-weight: bold;" class="mycode_b">N </span>Radio/phone push-to-talk<br />
<span style="font-weight: bold;" class="mycode_b">F9 </span>Self-mute<br />
<span style="font-weight: bold;" class="mycode_b">F8 </span>Toggle "who's talking" HUD<br />
<span style="font-weight: bold;" class="mycode_b">INSERT </span>Open settings panel<br />
<br />
All keys are rebindable in the in-game panel.<br />
<hr class="mycode_hr" />
Building from Source<br />
<span style="font-weight: bold;" class="mycode_b">One-shot Windows build:</span><br />
powershell -ExecutionPolicy Bypass -File .\build.ps1<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Manual CMake (production config, x86):</span><br />
cmake -S . -B build -A Win32 -DVC_NO_SODIUM=OFF -DVC_WITH_OPUS=ON -DVC_BUILD_CLIENT=ON<br />
cmake --build build --config Release<br />
<br />
All third-party dependencies (libsodium, Opus, Dear ImGui, MinHook, RNNoise) are fetched and built automatically by CMake — no manual installs needed.<br />
CI/CD via GitHub Actions builds and tests on every push. Tagged releases (v*) publish ready-to-use bundles automatically.<br />
<hr class="mycode_hr" />
Current Status<br />
Core engine and all major features are implemented and validated in-game (2-player proximity with occlusion + falloff, radio/phone channels, speakerphone, RNNoise, ImGui panel).<br />
<span style="font-weight: bold;" class="mycode_b">Remaining / planned:</span><ul class="mycode_list"><li>AEC (Acoustic Echo Cancellation) — deferred; headphones avoid the issue for now<br />
</li>
<li>Linux 32-bit.so for SA-MP (relay and open.mp component already build on Linux x64)<br />
</li>
</ul>
<hr class="mycode_hr" />
Download<br />
👉 <span style="font-weight: bold;" class="mycode_b">GitHub Releases:</span> <a href="https://github.com/staark-dev/omp-voice/releases" target="_blank" rel="noopener" class="mycode_url">https://github.com/staark-dev/omp-voice/releases</a><br />
<br />
Bundles available:<ul class="mycode_list"><li>voicechat-client-win32.zip<br />
 — client.asi + voicechat.ini<br />
</li>
<li>voicechat-server-win.zip<br />
 — server plugin + relay + includes + voice.ini<br />
</li>
<li>voicechat-relay-linux-x64.tar.gz<br />
 — relay binary for Linux servers<br />
</li>
</ul>
Each bundle includes an <br />
INSTALL.txt.<br />
<hr class="mycode_hr" />
License<br />
MIT — free to use, modify, and distribute. See <a href="https://github.com/staark-dev/omp-voice/blob/main/LICENSE" target="_blank" rel="noopener" class="mycode_url">LICENSE</a>.<br />
<hr class="mycode_hr" />
<span style="font-style: italic;" class="mycode_i">Feedback, bug reports, and pull requests are welcome on GitHub!</span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[MySQL for open.mp]]></title>
			<link>https://forum.open.mp/showthread.php?tid=4274</link>
			<pubDate>Mon, 01 Jun 2026 21:17:55 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=4409">Xyranaut</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=4274</guid>
			<description><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">omp-MySQL</span></span><br />
A modern, secure MySQL database component for open.mp — clean-room, with an industry-standard API.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Repo:</span> <a href="https://github.com/Mac-Andreas/omp-MySQL" target="_blank" rel="noopener" class="mycode_url">github.com/Mac-Andreas/omp-MySQL</a><br />
<span style="font-weight: bold;" class="mycode_b">Download (v1.0.0):</span> <a href="https://github.com/Mac-Andreas/omp-MySQL/releases/latest" target="_blank" rel="noopener" class="mycode_url">Releases</a><br />
<span style="font-weight: bold;" class="mycode_b">Docs / wiki:</span> <a href="https://github.com/Mac-Andreas/omp-MySQL/wiki" target="_blank" rel="noopener" class="mycode_url">Wiki</a><br />
<br />
<hr class="mycode_hr" />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">What is it?</span></span><br />
A native open.mp <span style="font-weight: bold;" class="mycode_b">component</span> (drops into <span style="font-family: Courier New;" class="mycode_font">components/</span>, not a legacy plugin) that lets your Pawn gamemode talk to MySQL — safely. It's inspired by the classic SA-MP-MySQL but rebuilt from scratch for modern MySQL and the open.mp Component SDK.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Why another MySQL plugin?</span></span><br />
SA-MP-MySQL (BlueG / maddinat0r) was excellent — for its time. That time was the MySQL 5.x / SA-MP era, and it's been <span style="font-weight: bold;" class="mycode_b">discontinued since ~2019</span>. Modern MySQL changed a lot (default <span style="font-family: Courier New;" class="mycode_font">caching_sha2_password</span> auth, mandatory-friendly TLS, utf8mb4), open.mp moved to a modern Component SDK, and security expectations rose. omp-MySQL is a clean-room project built for <span style="font-weight: bold;" class="mycode_b">today's</span> MySQL and open.mp: TLS is on by default, passwords are hashed for you, and player input is injection-safe by construction.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">omp-MySQL vs SA-MP-MySQL (BlueG)</span></span><br />
<table border="0" cellspacing="1" cellpadding="3" class="tborder" style="width:%;">
<tr><td class="trow1" valign="top" align="center"></td><td class="trow1" valign="top" align="center"><span style="font-weight: bold;" class="mycode_b">SA-MP-MySQL (BlueG)</span></td><td class="trow1" valign="top" align="center"><span style="font-weight: bold;" class="mycode_b">omp-MySQL</span></td></tr>
<tr><td class="trow1" valign="top" align="center">Plugs into</td><td class="trow1" valign="top" align="center">SA-MP plugin ABI</td><td class="trow1" valign="top" align="center">native open.mp Component SDK</td></tr>
<tr><td class="trow1" valign="top" align="center">MySQL era</td><td class="trow1" valign="top" align="center">5.x / MariaDB</td><td class="trow1" valign="top" align="center">modern 8.x / 9.x (also runs on 5.7)</td></tr>
<tr><td class="trow1" valign="top" align="center">Encryption</td><td class="trow1" valign="top" align="center">optional, often off</td><td class="trow1" valign="top" align="center">mandatory TLS, fail-closed (1.3/1.2)</td></tr>
<tr><td class="trow1" valign="top" align="center">Password hashing</td><td class="trow1" valign="top" align="center">none built in</td><td class="trow1" valign="top" align="center">Argon2id (mysql_hash / mysql_verify)</td></tr>
<tr><td class="trow1" valign="top" align="center">Injection safety</td><td class="trow1" valign="top" align="center">escape helpers</td><td class="trow1" valign="top" align="center">prepared statements + %e + multi-stmt off</td></tr>
<tr><td class="trow1" valign="top" align="center">API naming</td><td class="trow1" valign="top" align="center">SA-MP-MySQL specific</td><td class="trow1" valign="top" align="center">industry-standard (JDBC/DB-API style)</td></tr>
<tr><td class="trow1" valign="top" align="center">Secrets</td><td class="trow1" valign="top" align="center">usually in source</td><td class="trow1" valign="top" align="center">&#36;{ENV} expansion + optional obfuscation</td></tr>
<tr><td class="trow1" valign="top" align="center">Extras</td><td class="trow1" valign="top" align="center">cache, ORM</td><td class="trow1" valign="top" align="center">cache, models, VECTOR search, compression</td></tr>
<tr><td class="trow1" valign="top" align="center">Status</td><td class="trow1" valign="top" align="center">discontinued (~2019)</td><td class="trow1" valign="top" align="center">active, v1.0.0</td></tr>
</table>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Highlights</span></span><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Mandatory TLS, fail-closed</span> — TLS 1.3 (MySQL 8.0+) / TLS 1.2 (5.7); refuses to connect unencrypted. No plaintext path.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Prepared statements</span> — bound parameters, injection-safe (plus <span style="font-family: Courier New;" class="mycode_font">%e</span> escaping; multi-statements off by default).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Argon2id password hashing</span> built in.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Fully async</span> — one worker thread per connection; the main tick never blocks.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Self-contained</span> — MariaDB Connector/C statically linked, OpenSSL bundled. No separate client install.<br />
</li>
<li>Result cache, active-record <span style="font-weight: bold;" class="mycode_b">models</span>, MySQL 9 <span style="font-weight: bold;" class="mycode_b">VECTOR</span> similarity search, <span style="font-family: Courier New;" class="mycode_font">&#36;{ENV}</span> secrets, opt-in rate/length guards.<br />
</li>
</ul>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Tested</span></span><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Live MySQL</span>: 5.7.44, 8.0.46, 8.4.9 LTS, 9.2.0 — TLS + queries + prepared statements + caching_sha2 all pass. VECTOR verified on 9.x (it's 9.0+ only).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Memory</span>: clean under AddressSanitizer + UBSan; static leak/UAF/thread audit.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Pentested</span>: SQL injection (login box, registration, command args), auth bypass (rejoin / slot reuse), persistent-login enforcement, privilege bootstrap. Details in the wiki's Security page.<br />
</li>
</ul>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Quick example</span></span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;open.mp&gt;<br />
#include &lt;omp-mysql&gt;<br />
<br />
new MySQL:g_DB;<br />
<br />
public OnGameModeInit()<br />
{<br />
    new MySQLConfig:cfg = mysql_config_create();<br />
    mysql_config_set(cfg, SSL_MODE, SSL_MODE_REQUIRED);  // TLS on<br />
    g_DB = mysql_connect("127.0.0.1", "user", "&#36;{OMP_DB_PASS}", "mydb", cfg);<br />
    if (g_DB == MYSQL_INVALID_HANDLE) print("MySQL connection failed.");<br />
    return 1;<br />
}</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Install</span></span><br />
<ol type="1" class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Windows:</span> unzip the windows package — <span style="font-family: Courier New;" class="mycode_font">omp-mysql.dll</span> into <span style="font-family: Courier New;" class="mycode_font">components/</span>, and the bundled <span style="font-family: Courier New;" class="mycode_font">libssl-3.dll</span> / <span style="font-family: Courier New;" class="mycode_font">libcrypto-3.dll</span> next to <span style="font-family: Courier New;" class="mycode_font">omp-server.exe</span>.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Linux:</span> <span style="font-family: Courier New;" class="mycode_font">omp-mysql.so</span> into <span style="font-family: Courier New;" class="mycode_font">components/</span>.<br />
</li>
<li>Put <span style="font-family: Courier New;" class="mycode_font">omp-mysql.inc</span> in <span style="font-family: Courier New;" class="mycode_font">qawno/include/</span> and <span style="font-family: Courier New;" class="mycode_font">#include &lt;omp-mysql&gt;</span>.<br />
</li>
</ol>
A full <span style="font-weight: bold;" class="mycode_b">login/register admin demo</span> (<span style="font-family: Courier New;" class="mycode_font">mysql-admin</span>) ships in the release.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Migrating from SA-MP-MySQL</span></span><br />
Same concepts (connect → query → callback → read rows); modern/standard names. Most-used mappings:<br />
<table border="0" cellspacing="1" cellpadding="3" class="tborder" style="width:%;">
<tr><td class="trow1" valign="top" align="center"><span style="font-weight: bold;" class="mycode_b">SA-MP-MySQL</span></td><td class="trow1" valign="top" align="center"><span style="font-weight: bold;" class="mycode_b">omp-MySQL</span></td></tr>
<tr><td class="trow1" valign="top" align="center">mysql_tquery</td><td class="trow1" valign="top" align="center">mysql_execute</td></tr>
<tr><td class="trow1" valign="top" align="center">mysql_pquery</td><td class="trow1" valign="top" align="center">mysql_execute_for</td></tr>
<tr><td class="trow1" valign="top" align="center">mysql_query</td><td class="trow1" valign="top" align="center">mysql_execute_sync</td></tr>
<tr><td class="trow1" valign="top" align="center">cache_get_value_name_int</td><td class="trow1" valign="top" align="center">mysql_rs_get_int_by</td></tr>
<tr><td class="trow1" valign="top" align="center">cache_num_rows</td><td class="trow1" valign="top" align="center">mysql_rs_row_count</td></tr>
<tr><td class="trow1" valign="top" align="center">cache_insert_id</td><td class="trow1" valign="top" align="center">mysql_rs_insert_id</td></tr>
<tr><td class="trow1" valign="top" align="center">mysql_get_ssl_cipher</td><td class="trow1" valign="top" align="center">mysql_get_tls_cipher</td></tr>
<tr><td class="trow1" valign="top" align="center">(none)</td><td class="trow1" valign="top" align="center">mysql_prepare / mysql_stmt_set_*</td></tr>
<tr><td class="trow1" valign="top" align="center">(none)</td><td class="trow1" valign="top" align="center">mysql_hash / mysql_verify</td></tr>
<tr><td class="trow1" valign="top" align="center">orm_*</td><td class="trow1" valign="top" align="center">mysql_model_*</td></tr>
</table>
Two convention changes: prepared-statement params are <span style="font-weight: bold;" class="mycode_b">1-based</span>, and result values use the <span style="font-family: Courier New;" class="mycode_font">mysql_rs_*</span> family. Full guide: <a href="https://github.com/Mac-Andreas/omp-MySQL/wiki/Migrating-from-SA-MP-MySQL" target="_blank" rel="noopener" class="mycode_url">Migration</a>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Docs</span></span><br />
The <a href="https://github.com/Mac-Andreas/omp-MySQL/wiki" target="_blank" rel="noopener" class="mycode_url">wiki</a> is a full book — from "what is a database?" (with diagrams) through installing MySQL, SQL basics, prepared statements, async patterns, the mysql-admin demo, building from source, and security. There's a one-page <a href="https://github.com/Mac-Andreas/omp-MySQL/wiki/Cheat-Sheet" target="_blank" rel="noopener" class="mycode_url">cheat sheet</a> too.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Notes</span></span><ul class="mycode_list"><li>Minimum MySQL <span style="font-weight: bold;" class="mycode_b">5.7</span> (first with default TLS). Recommended <span style="font-weight: bold;" class="mycode_b">8.4 LTS</span>.<br />
</li>
<li>32-bit (i386) — the open.mp server arch.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">MIT</span> licensed (links the LGPL-2.1 MariaDB Connector/C). No code reused from SA-MP-MySQL.<br />
</li>
</ul>
<br />
Feedback, bug reports, and PRs welcome — <a href="https://github.com/Mac-Andreas/omp-MySQL/issues" target="_blank" rel="noopener" class="mycode_url">issues</a>.<br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="font-style: italic;" class="mycode_i">omp-MySQL is an independent community project — not affiliated with or endorsed by open.mp or Oracle. "MySQL" is a trademark of Oracle; "open.mp" and "SA-MP" of their respective authors; used here only to describe compatibility.</span></span>]]></description>
			<content:encoded><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">omp-MySQL</span></span><br />
A modern, secure MySQL database component for open.mp — clean-room, with an industry-standard API.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Repo:</span> <a href="https://github.com/Mac-Andreas/omp-MySQL" target="_blank" rel="noopener" class="mycode_url">github.com/Mac-Andreas/omp-MySQL</a><br />
<span style="font-weight: bold;" class="mycode_b">Download (v1.0.0):</span> <a href="https://github.com/Mac-Andreas/omp-MySQL/releases/latest" target="_blank" rel="noopener" class="mycode_url">Releases</a><br />
<span style="font-weight: bold;" class="mycode_b">Docs / wiki:</span> <a href="https://github.com/Mac-Andreas/omp-MySQL/wiki" target="_blank" rel="noopener" class="mycode_url">Wiki</a><br />
<br />
<hr class="mycode_hr" />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">What is it?</span></span><br />
A native open.mp <span style="font-weight: bold;" class="mycode_b">component</span> (drops into <span style="font-family: Courier New;" class="mycode_font">components/</span>, not a legacy plugin) that lets your Pawn gamemode talk to MySQL — safely. It's inspired by the classic SA-MP-MySQL but rebuilt from scratch for modern MySQL and the open.mp Component SDK.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Why another MySQL plugin?</span></span><br />
SA-MP-MySQL (BlueG / maddinat0r) was excellent — for its time. That time was the MySQL 5.x / SA-MP era, and it's been <span style="font-weight: bold;" class="mycode_b">discontinued since ~2019</span>. Modern MySQL changed a lot (default <span style="font-family: Courier New;" class="mycode_font">caching_sha2_password</span> auth, mandatory-friendly TLS, utf8mb4), open.mp moved to a modern Component SDK, and security expectations rose. omp-MySQL is a clean-room project built for <span style="font-weight: bold;" class="mycode_b">today's</span> MySQL and open.mp: TLS is on by default, passwords are hashed for you, and player input is injection-safe by construction.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">omp-MySQL vs SA-MP-MySQL (BlueG)</span></span><br />
<table border="0" cellspacing="1" cellpadding="3" class="tborder" style="width:%;">
<tr><td class="trow1" valign="top" align="center"></td><td class="trow1" valign="top" align="center"><span style="font-weight: bold;" class="mycode_b">SA-MP-MySQL (BlueG)</span></td><td class="trow1" valign="top" align="center"><span style="font-weight: bold;" class="mycode_b">omp-MySQL</span></td></tr>
<tr><td class="trow1" valign="top" align="center">Plugs into</td><td class="trow1" valign="top" align="center">SA-MP plugin ABI</td><td class="trow1" valign="top" align="center">native open.mp Component SDK</td></tr>
<tr><td class="trow1" valign="top" align="center">MySQL era</td><td class="trow1" valign="top" align="center">5.x / MariaDB</td><td class="trow1" valign="top" align="center">modern 8.x / 9.x (also runs on 5.7)</td></tr>
<tr><td class="trow1" valign="top" align="center">Encryption</td><td class="trow1" valign="top" align="center">optional, often off</td><td class="trow1" valign="top" align="center">mandatory TLS, fail-closed (1.3/1.2)</td></tr>
<tr><td class="trow1" valign="top" align="center">Password hashing</td><td class="trow1" valign="top" align="center">none built in</td><td class="trow1" valign="top" align="center">Argon2id (mysql_hash / mysql_verify)</td></tr>
<tr><td class="trow1" valign="top" align="center">Injection safety</td><td class="trow1" valign="top" align="center">escape helpers</td><td class="trow1" valign="top" align="center">prepared statements + %e + multi-stmt off</td></tr>
<tr><td class="trow1" valign="top" align="center">API naming</td><td class="trow1" valign="top" align="center">SA-MP-MySQL specific</td><td class="trow1" valign="top" align="center">industry-standard (JDBC/DB-API style)</td></tr>
<tr><td class="trow1" valign="top" align="center">Secrets</td><td class="trow1" valign="top" align="center">usually in source</td><td class="trow1" valign="top" align="center">&#36;{ENV} expansion + optional obfuscation</td></tr>
<tr><td class="trow1" valign="top" align="center">Extras</td><td class="trow1" valign="top" align="center">cache, ORM</td><td class="trow1" valign="top" align="center">cache, models, VECTOR search, compression</td></tr>
<tr><td class="trow1" valign="top" align="center">Status</td><td class="trow1" valign="top" align="center">discontinued (~2019)</td><td class="trow1" valign="top" align="center">active, v1.0.0</td></tr>
</table>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Highlights</span></span><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Mandatory TLS, fail-closed</span> — TLS 1.3 (MySQL 8.0+) / TLS 1.2 (5.7); refuses to connect unencrypted. No plaintext path.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Prepared statements</span> — bound parameters, injection-safe (plus <span style="font-family: Courier New;" class="mycode_font">%e</span> escaping; multi-statements off by default).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Argon2id password hashing</span> built in.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Fully async</span> — one worker thread per connection; the main tick never blocks.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Self-contained</span> — MariaDB Connector/C statically linked, OpenSSL bundled. No separate client install.<br />
</li>
<li>Result cache, active-record <span style="font-weight: bold;" class="mycode_b">models</span>, MySQL 9 <span style="font-weight: bold;" class="mycode_b">VECTOR</span> similarity search, <span style="font-family: Courier New;" class="mycode_font">&#36;{ENV}</span> secrets, opt-in rate/length guards.<br />
</li>
</ul>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Tested</span></span><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Live MySQL</span>: 5.7.44, 8.0.46, 8.4.9 LTS, 9.2.0 — TLS + queries + prepared statements + caching_sha2 all pass. VECTOR verified on 9.x (it's 9.0+ only).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Memory</span>: clean under AddressSanitizer + UBSan; static leak/UAF/thread audit.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Pentested</span>: SQL injection (login box, registration, command args), auth bypass (rejoin / slot reuse), persistent-login enforcement, privilege bootstrap. Details in the wiki's Security page.<br />
</li>
</ul>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Quick example</span></span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;open.mp&gt;<br />
#include &lt;omp-mysql&gt;<br />
<br />
new MySQL:g_DB;<br />
<br />
public OnGameModeInit()<br />
{<br />
    new MySQLConfig:cfg = mysql_config_create();<br />
    mysql_config_set(cfg, SSL_MODE, SSL_MODE_REQUIRED);  // TLS on<br />
    g_DB = mysql_connect("127.0.0.1", "user", "&#36;{OMP_DB_PASS}", "mydb", cfg);<br />
    if (g_DB == MYSQL_INVALID_HANDLE) print("MySQL connection failed.");<br />
    return 1;<br />
}</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Install</span></span><br />
<ol type="1" class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Windows:</span> unzip the windows package — <span style="font-family: Courier New;" class="mycode_font">omp-mysql.dll</span> into <span style="font-family: Courier New;" class="mycode_font">components/</span>, and the bundled <span style="font-family: Courier New;" class="mycode_font">libssl-3.dll</span> / <span style="font-family: Courier New;" class="mycode_font">libcrypto-3.dll</span> next to <span style="font-family: Courier New;" class="mycode_font">omp-server.exe</span>.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Linux:</span> <span style="font-family: Courier New;" class="mycode_font">omp-mysql.so</span> into <span style="font-family: Courier New;" class="mycode_font">components/</span>.<br />
</li>
<li>Put <span style="font-family: Courier New;" class="mycode_font">omp-mysql.inc</span> in <span style="font-family: Courier New;" class="mycode_font">qawno/include/</span> and <span style="font-family: Courier New;" class="mycode_font">#include &lt;omp-mysql&gt;</span>.<br />
</li>
</ol>
A full <span style="font-weight: bold;" class="mycode_b">login/register admin demo</span> (<span style="font-family: Courier New;" class="mycode_font">mysql-admin</span>) ships in the release.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Migrating from SA-MP-MySQL</span></span><br />
Same concepts (connect → query → callback → read rows); modern/standard names. Most-used mappings:<br />
<table border="0" cellspacing="1" cellpadding="3" class="tborder" style="width:%;">
<tr><td class="trow1" valign="top" align="center"><span style="font-weight: bold;" class="mycode_b">SA-MP-MySQL</span></td><td class="trow1" valign="top" align="center"><span style="font-weight: bold;" class="mycode_b">omp-MySQL</span></td></tr>
<tr><td class="trow1" valign="top" align="center">mysql_tquery</td><td class="trow1" valign="top" align="center">mysql_execute</td></tr>
<tr><td class="trow1" valign="top" align="center">mysql_pquery</td><td class="trow1" valign="top" align="center">mysql_execute_for</td></tr>
<tr><td class="trow1" valign="top" align="center">mysql_query</td><td class="trow1" valign="top" align="center">mysql_execute_sync</td></tr>
<tr><td class="trow1" valign="top" align="center">cache_get_value_name_int</td><td class="trow1" valign="top" align="center">mysql_rs_get_int_by</td></tr>
<tr><td class="trow1" valign="top" align="center">cache_num_rows</td><td class="trow1" valign="top" align="center">mysql_rs_row_count</td></tr>
<tr><td class="trow1" valign="top" align="center">cache_insert_id</td><td class="trow1" valign="top" align="center">mysql_rs_insert_id</td></tr>
<tr><td class="trow1" valign="top" align="center">mysql_get_ssl_cipher</td><td class="trow1" valign="top" align="center">mysql_get_tls_cipher</td></tr>
<tr><td class="trow1" valign="top" align="center">(none)</td><td class="trow1" valign="top" align="center">mysql_prepare / mysql_stmt_set_*</td></tr>
<tr><td class="trow1" valign="top" align="center">(none)</td><td class="trow1" valign="top" align="center">mysql_hash / mysql_verify</td></tr>
<tr><td class="trow1" valign="top" align="center">orm_*</td><td class="trow1" valign="top" align="center">mysql_model_*</td></tr>
</table>
Two convention changes: prepared-statement params are <span style="font-weight: bold;" class="mycode_b">1-based</span>, and result values use the <span style="font-family: Courier New;" class="mycode_font">mysql_rs_*</span> family. Full guide: <a href="https://github.com/Mac-Andreas/omp-MySQL/wiki/Migrating-from-SA-MP-MySQL" target="_blank" rel="noopener" class="mycode_url">Migration</a>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Docs</span></span><br />
The <a href="https://github.com/Mac-Andreas/omp-MySQL/wiki" target="_blank" rel="noopener" class="mycode_url">wiki</a> is a full book — from "what is a database?" (with diagrams) through installing MySQL, SQL basics, prepared statements, async patterns, the mysql-admin demo, building from source, and security. There's a one-page <a href="https://github.com/Mac-Andreas/omp-MySQL/wiki/Cheat-Sheet" target="_blank" rel="noopener" class="mycode_url">cheat sheet</a> too.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Notes</span></span><ul class="mycode_list"><li>Minimum MySQL <span style="font-weight: bold;" class="mycode_b">5.7</span> (first with default TLS). Recommended <span style="font-weight: bold;" class="mycode_b">8.4 LTS</span>.<br />
</li>
<li>32-bit (i386) — the open.mp server arch.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">MIT</span> licensed (links the LGPL-2.1 MariaDB Connector/C). No code reused from SA-MP-MySQL.<br />
</li>
</ul>
<br />
Feedback, bug reports, and PRs welcome — <a href="https://github.com/Mac-Andreas/omp-MySQL/issues" target="_blank" rel="noopener" class="mycode_url">issues</a>.<br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="font-style: italic;" class="mycode_i">omp-MySQL is an independent community project — not affiliated with or endorsed by open.mp or Oracle. "MySQL" is a trademark of Oracle; "open.mp" and "SA-MP" of their respective authors; used here only to describe compatibility.</span></span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[FCNPC for open.mp - the classic FCNPC API, ported]]></title>
			<link>https://forum.open.mp/showthread.php?tid=4265</link>
			<pubDate>Tue, 26 May 2026 01:26:27 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=4409">Xyranaut</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=4265</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b">FCNPC for open.mp - the classic FCNPC API, ported</span><br />
<span style="font-weight: bold;" class="mycode_b">Repo:</span> <a href="https://github.com/Mac-Andreas/open.mp-FCNPC" target="_blank" rel="noopener" class="mycode_url">https://github.com/Mac-Andreas/open.mp-FCNPC</a><br />
<span style="font-weight: bold;" class="mycode_b">Download (DLL + SO + INC + test script):</span> <a href="https://github.com/Mac-Andreas/open.mp-FCNPC/releases/latest" target="_blank" rel="noopener" class="mycode_url">releases/latest</a><br />
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">What is this</span><br />
<span style="font-weight: bold;" class="mycode_b">Fully Controllable NPC</span> - the classic <a href="https://github.com/ziggi/FCNPC" target="_blank" rel="noopener" class="mycode_url">FCNPC</a> FCNPC_* Pawn API, re-implemented for <a href="https://github.com/openmultiplayer/open.mp" target="_blank" rel="noopener" class="mycode_url">open.mp</a>.<br />
<br />
The original FCNPC is a SA-MP plugin: it drives NPCs by patching the samp03svr binary at fixed memory addresses and injecting raw RakNet packets. That cannot work on open.mp - a different, open-source binary with a proper component SDK. open.mp instead ships a built-in NPC engine (INPCComponent).<br />
<br />
This component is a <span style="font-weight: bold;" class="mycode_b">compatibility layer</span>: it re-exposes the FCNPC_* natives on top of INPCComponent, <span style="font-weight: bold;" class="mycode_b">plus the remaining ~5% of FCNPC that open.mp's NPC engine does not provide</span>. Existing FCNPC gamemodes run largely unmodified.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Status</span><br />
All <span style="font-weight: bold;" class="mycode_b">182</span> FCNPC_* natives are declared in FCNPC.inc and implemented: <span style="font-weight: bold;" class="mycode_b">180 ported, 2 pending</span>. Most call open.mp's INPC / INPCComponent / IPlayer directly; the features open.mp lacks are hand-rolled in this component. Full per-native breakdown is in port-status.md.<br />
<br />
A couple of the gaps it fills (things bare INPCComponent does not do):<ul class="mycode_list"><li>FCNPC_GoToPlayer - open.mp's moveToPlayer defaults autoRestart = false, so the NPC walks to the player's initial spot then stops. This port forces continuous re-tracking, so the NPC keeps chasing a moving player.<br />
</li>
<li>FCNPC_SetMoveMode (MAPANDREAS / COLANDREAS) - INPC::move does no terrain grounding (NPCs float / sit on roofs). The component samples ground Z each tick via the companion plugin while the NPC moves.<br />
</li>
</ul>
Nothing falls back to SA-MP.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Install</span><br />
<ol type="1" class="mycode_list"><li>Download the latest release.<br />
</li>
<li>Put FCNPC.dll (Windows) / FCNPC.so (Linux) into your server's components/.<br />
</li>
<li>Put FCNPC.inc into your Pawn qawno/include/.<br />
</li>
<li>Make sure the NPC component is enabled in config.json (ships with open.mp).<br />
</li>
</ol>
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;open.mp&gt;<br />
#include &lt;FCNPC&gt;<br />
<br />
public OnGameModeInit()<br />
{<br />
    new id = FCNPC_Create("Bot");<br />
    FCNPC_Spawn(id, 0, 1958.33, 1343.12, 15.36);<br />
    return 1;<br />
}<br />
<br />
public OnPlayerConnect(playerid)<br />
{<br />
    // walk every bot to the new player<br />
    new npcs[100], count = FCNPC_GetValidArray(npcs);<br />
    for (new i = 0; i &lt; count; i++)<br />
        FCNPC_GoToPlayer(npcs[i], playerid, FCNPC_MOVE_TYPE_RUN);<br />
    return 1;<br />
}</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Test it in-game (and see exactly what is ported)</span><br />
The release ships fcnpc_test.pwn (also in the repo under test/). It is two things at once: a <span style="font-weight: bold;" class="mycode_b">feature test</span> that drives every category of the API live, and a <span style="font-weight: bold;" class="mycode_b">showcase of what this port adds over the bare open.mp engine</span> - so you can verify, in-game, the parts of FCNPC that INPCComponent never implemented.<br />
<br />
Load it as a filterscript and type <span style="font-weight: bold;" class="mycode_b">/fcnpc</span> for a dialog menu:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Commands</span> - spawn / walk / run / sprint / follow (chase) / aim / shoot / melee / animation / enter+exit vehicle / move-path patrol / play node / invulnerable / kill / respawn / stop all / destroy. One button per native group, run on a demo NPC in front of you.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Config</span> - live tunables (move type/mode/pathfinding/speed, weapon/ammo/reloading/fighting style/accuracy, skin/health/armour, plugin update+tick rate, global ColAndreas/raycast modes) with defaults shown + restore-to-defaults.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Ported features (INPC vs FCNPC)</span> - the important one. It spawns a <span style="font-weight: bold;" class="mycode_b">native INPC NPC</span> and an <span style="font-weight: bold;" class="mycode_b">FCNPC NPC</span> side by side, labelled with floating 3D text ("INPC" / "FCNPC") so you can tell them apart, and lets you fire the same action at both to compare. Every test prints three lines in chat: the <span style="font-weight: bold;" class="mycode_b">intended</span> behaviour, <span style="font-weight: bold;" class="mycode_b">what bare INPC does</span>, and <span style="font-weight: bold;" class="mycode_b">what FCNPC does</span>. Current comparisons:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Chase / autoRestart</span> - INPC NPC_MoveToPlayer defaults autoRestart = false: it walks to your starting spot and stops, even as you move. FCNPC keeps re-tracking and chasing you. (This is the headline gap the port fills.)<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Rotation</span> - SetAngleToPlayer on the native INPC vs the FCNPC NPC, so the facing/orientation behaviour is directly comparable.<br />
</li>
</ul>
This section is how the "remaining ~5% open.mp's NPC engine does not provide" stops being a claim and becomes something you watch happen.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Debug</span> - on-screen HUD (state, health, weapon, moving, speed, distance to you).<br />
</li>
</ul>
Needs &lt;open.mp&gt;, &lt;omp_npc&gt; and &lt;FCNPC&gt; - no other dependencies.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Companion plugins</span><br />
The collision / heightmap / surfing natives call the standalone plugins at runtime (the same companion-plugin model the original FCNPC used) - install the open.mp builds:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/philip1337/samp-plugin-mapandreas/releases" target="_blank" rel="noopener" class="mycode_url">MapAndreas</a></span> (heightmap Z) - Philip<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/Pottus/ColAndreas/releases" target="_blank" rel="noopener" class="mycode_url">ColAndreas</a></span> (full map collision / raycasting) - Pottus, uL Chris42O, Slice<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/samp-incognito/samp-streamer-plugin/releases" target="_blank" rel="noopener" class="mycode_url">Streamer</a></span> (dynamic objects, for FCNPC_*SurfingDynamicObject) - Incognito<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">Build from source</span>open.mp's Windows server is x86 and components must use the Microsoft C++ ABI. The repo includes a no-Visual-Studio cross-build (clang-cl + lld against the MSVC SDK via msvc-wine), a Windows CMake path, and a Linux .so path. CI builds FCNPC.dll + FCNPC.so and attaches them with FCNPC.inc to every tagged release.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Credits</span><ul class="mycode_list"><li>Original FCNPC: OrMisicL (2013-2015), ziggi (2016-2024).<br />
</li>
<li>open.mp NPC engine (INPCComponent): the open.mp team.<br />
</li>
<li>open.mp port: Xyranaut.<br />
</li>
<li>Companion plugins: MapAndreas (Philip), ColAndreas (Pottus, uL Chris42O, Slice), Streamer (Incognito).<br />
</li>
</ul>
<br />
<hr class="mycode_hr" />
Bug reports / PRs welcome on the repo. Tested against open.mp 1.5.x.]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b">FCNPC for open.mp - the classic FCNPC API, ported</span><br />
<span style="font-weight: bold;" class="mycode_b">Repo:</span> <a href="https://github.com/Mac-Andreas/open.mp-FCNPC" target="_blank" rel="noopener" class="mycode_url">https://github.com/Mac-Andreas/open.mp-FCNPC</a><br />
<span style="font-weight: bold;" class="mycode_b">Download (DLL + SO + INC + test script):</span> <a href="https://github.com/Mac-Andreas/open.mp-FCNPC/releases/latest" target="_blank" rel="noopener" class="mycode_url">releases/latest</a><br />
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">What is this</span><br />
<span style="font-weight: bold;" class="mycode_b">Fully Controllable NPC</span> - the classic <a href="https://github.com/ziggi/FCNPC" target="_blank" rel="noopener" class="mycode_url">FCNPC</a> FCNPC_* Pawn API, re-implemented for <a href="https://github.com/openmultiplayer/open.mp" target="_blank" rel="noopener" class="mycode_url">open.mp</a>.<br />
<br />
The original FCNPC is a SA-MP plugin: it drives NPCs by patching the samp03svr binary at fixed memory addresses and injecting raw RakNet packets. That cannot work on open.mp - a different, open-source binary with a proper component SDK. open.mp instead ships a built-in NPC engine (INPCComponent).<br />
<br />
This component is a <span style="font-weight: bold;" class="mycode_b">compatibility layer</span>: it re-exposes the FCNPC_* natives on top of INPCComponent, <span style="font-weight: bold;" class="mycode_b">plus the remaining ~5% of FCNPC that open.mp's NPC engine does not provide</span>. Existing FCNPC gamemodes run largely unmodified.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Status</span><br />
All <span style="font-weight: bold;" class="mycode_b">182</span> FCNPC_* natives are declared in FCNPC.inc and implemented: <span style="font-weight: bold;" class="mycode_b">180 ported, 2 pending</span>. Most call open.mp's INPC / INPCComponent / IPlayer directly; the features open.mp lacks are hand-rolled in this component. Full per-native breakdown is in port-status.md.<br />
<br />
A couple of the gaps it fills (things bare INPCComponent does not do):<ul class="mycode_list"><li>FCNPC_GoToPlayer - open.mp's moveToPlayer defaults autoRestart = false, so the NPC walks to the player's initial spot then stops. This port forces continuous re-tracking, so the NPC keeps chasing a moving player.<br />
</li>
<li>FCNPC_SetMoveMode (MAPANDREAS / COLANDREAS) - INPC::move does no terrain grounding (NPCs float / sit on roofs). The component samples ground Z each tick via the companion plugin while the NPC moves.<br />
</li>
</ul>
Nothing falls back to SA-MP.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Install</span><br />
<ol type="1" class="mycode_list"><li>Download the latest release.<br />
</li>
<li>Put FCNPC.dll (Windows) / FCNPC.so (Linux) into your server's components/.<br />
</li>
<li>Put FCNPC.inc into your Pawn qawno/include/.<br />
</li>
<li>Make sure the NPC component is enabled in config.json (ships with open.mp).<br />
</li>
</ol>
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;open.mp&gt;<br />
#include &lt;FCNPC&gt;<br />
<br />
public OnGameModeInit()<br />
{<br />
    new id = FCNPC_Create("Bot");<br />
    FCNPC_Spawn(id, 0, 1958.33, 1343.12, 15.36);<br />
    return 1;<br />
}<br />
<br />
public OnPlayerConnect(playerid)<br />
{<br />
    // walk every bot to the new player<br />
    new npcs[100], count = FCNPC_GetValidArray(npcs);<br />
    for (new i = 0; i &lt; count; i++)<br />
        FCNPC_GoToPlayer(npcs[i], playerid, FCNPC_MOVE_TYPE_RUN);<br />
    return 1;<br />
}</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Test it in-game (and see exactly what is ported)</span><br />
The release ships fcnpc_test.pwn (also in the repo under test/). It is two things at once: a <span style="font-weight: bold;" class="mycode_b">feature test</span> that drives every category of the API live, and a <span style="font-weight: bold;" class="mycode_b">showcase of what this port adds over the bare open.mp engine</span> - so you can verify, in-game, the parts of FCNPC that INPCComponent never implemented.<br />
<br />
Load it as a filterscript and type <span style="font-weight: bold;" class="mycode_b">/fcnpc</span> for a dialog menu:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Commands</span> - spawn / walk / run / sprint / follow (chase) / aim / shoot / melee / animation / enter+exit vehicle / move-path patrol / play node / invulnerable / kill / respawn / stop all / destroy. One button per native group, run on a demo NPC in front of you.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Config</span> - live tunables (move type/mode/pathfinding/speed, weapon/ammo/reloading/fighting style/accuracy, skin/health/armour, plugin update+tick rate, global ColAndreas/raycast modes) with defaults shown + restore-to-defaults.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Ported features (INPC vs FCNPC)</span> - the important one. It spawns a <span style="font-weight: bold;" class="mycode_b">native INPC NPC</span> and an <span style="font-weight: bold;" class="mycode_b">FCNPC NPC</span> side by side, labelled with floating 3D text ("INPC" / "FCNPC") so you can tell them apart, and lets you fire the same action at both to compare. Every test prints three lines in chat: the <span style="font-weight: bold;" class="mycode_b">intended</span> behaviour, <span style="font-weight: bold;" class="mycode_b">what bare INPC does</span>, and <span style="font-weight: bold;" class="mycode_b">what FCNPC does</span>. Current comparisons:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Chase / autoRestart</span> - INPC NPC_MoveToPlayer defaults autoRestart = false: it walks to your starting spot and stops, even as you move. FCNPC keeps re-tracking and chasing you. (This is the headline gap the port fills.)<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Rotation</span> - SetAngleToPlayer on the native INPC vs the FCNPC NPC, so the facing/orientation behaviour is directly comparable.<br />
</li>
</ul>
This section is how the "remaining ~5% open.mp's NPC engine does not provide" stops being a claim and becomes something you watch happen.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Debug</span> - on-screen HUD (state, health, weapon, moving, speed, distance to you).<br />
</li>
</ul>
Needs &lt;open.mp&gt;, &lt;omp_npc&gt; and &lt;FCNPC&gt; - no other dependencies.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Companion plugins</span><br />
The collision / heightmap / surfing natives call the standalone plugins at runtime (the same companion-plugin model the original FCNPC used) - install the open.mp builds:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/philip1337/samp-plugin-mapandreas/releases" target="_blank" rel="noopener" class="mycode_url">MapAndreas</a></span> (heightmap Z) - Philip<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/Pottus/ColAndreas/releases" target="_blank" rel="noopener" class="mycode_url">ColAndreas</a></span> (full map collision / raycasting) - Pottus, uL Chris42O, Slice<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/samp-incognito/samp-streamer-plugin/releases" target="_blank" rel="noopener" class="mycode_url">Streamer</a></span> (dynamic objects, for FCNPC_*SurfingDynamicObject) - Incognito<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">Build from source</span>open.mp's Windows server is x86 and components must use the Microsoft C++ ABI. The repo includes a no-Visual-Studio cross-build (clang-cl + lld against the MSVC SDK via msvc-wine), a Windows CMake path, and a Linux .so path. CI builds FCNPC.dll + FCNPC.so and attaches them with FCNPC.inc to every tagged release.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Credits</span><ul class="mycode_list"><li>Original FCNPC: OrMisicL (2013-2015), ziggi (2016-2024).<br />
</li>
<li>open.mp NPC engine (INPCComponent): the open.mp team.<br />
</li>
<li>open.mp port: Xyranaut.<br />
</li>
<li>Companion plugins: MapAndreas (Philip), ColAndreas (Pottus, uL Chris42O, Slice), Streamer (Incognito).<br />
</li>
</ul>
<br />
<hr class="mycode_hr" />
Bug reports / PRs welcome on the repo. Tested against open.mp 1.5.x.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[mysql_samp]]></title>
			<link>https://forum.open.mp/showthread.php?tid=3822</link>
			<pubDate>Tue, 10 Mar 2026 03:33:51 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=7983">NullSablex</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=3822</guid>
			<description><![CDATA[<div style="text-align: justify;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b">mysql_samp - Um plugin MySQL escrito em Rust</span><br />
<br />
Criei esse plugin porque o R41-4 parou de funcionar no meu servidor.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">O Problema Real</span><br />
<br />
Em alguns ambientes Linux modernos (Debian 13, AlmaLinux), o socket do MySQL mudou de local. O socket não está mais em <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/tmp/mysql.sock</code></div></div>. Quando tentava conectar com localhost, levava esse erro:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Conexão falhou — Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)</code></div></div><br />
O R41-4 simplesmente não consegue encontrar o socket. E pior: tem um bug chato com SSL que ninguém resolveu.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">O Bug de SSL</span><br />
<br />
Mesmo que você <span style="font-weight: bold;" class="mycode_b">não esteja usando SSL</span>, o plugin sempre reclama. Coloca a opção como desativado? Continua exigindo. É como se o plugin ignorasse completamente as opções de SSL que você passa.<br />
<br />
Basicamente, com essas limitações, o R41-4 virou inútil pra mim.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Por Que Rust</span><br />
<br />
Resolvi fazer do zero porque:<br />
- Encontra socket em qualquer lugar (suporta caminhos customizados)<br />
- Sem libmysqlclient bagunçando tudo<br />
- SSL funciona como deveria (você ativa, ativa; desativa, desativa)<br />
- Código novo, sem bugs antigos carregados<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Funciona?</span><br />
<br />
Sim. Testei nos ambientes problemáticos e continua funcionando. Sem aquele erro de socket. Sem aquela brincadeira de SSL.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Links</span><br />
<br />
GitHub: <a href="https://github.com/NullSablex/mysql_samp" target="_blank" rel="noopener" class="mycode_url">https://github.com/NullSablex/mysql_samp</a><br />
Releases: <a href="https://github.com/NullSablex/mysql_samp/releases" target="_blank" rel="noopener" class="mycode_url">https://github.com/NullSablex/mysql_samp/releases</a><br />
<br />
Se alguém tá com o mesmo problema, talvez ajude.</div>]]></description>
			<content:encoded><![CDATA[<div style="text-align: justify;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b">mysql_samp - Um plugin MySQL escrito em Rust</span><br />
<br />
Criei esse plugin porque o R41-4 parou de funcionar no meu servidor.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">O Problema Real</span><br />
<br />
Em alguns ambientes Linux modernos (Debian 13, AlmaLinux), o socket do MySQL mudou de local. O socket não está mais em <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/tmp/mysql.sock</code></div></div>. Quando tentava conectar com localhost, levava esse erro:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Conexão falhou — Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)</code></div></div><br />
O R41-4 simplesmente não consegue encontrar o socket. E pior: tem um bug chato com SSL que ninguém resolveu.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">O Bug de SSL</span><br />
<br />
Mesmo que você <span style="font-weight: bold;" class="mycode_b">não esteja usando SSL</span>, o plugin sempre reclama. Coloca a opção como desativado? Continua exigindo. É como se o plugin ignorasse completamente as opções de SSL que você passa.<br />
<br />
Basicamente, com essas limitações, o R41-4 virou inútil pra mim.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Por Que Rust</span><br />
<br />
Resolvi fazer do zero porque:<br />
- Encontra socket em qualquer lugar (suporta caminhos customizados)<br />
- Sem libmysqlclient bagunçando tudo<br />
- SSL funciona como deveria (você ativa, ativa; desativa, desativa)<br />
- Código novo, sem bugs antigos carregados<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Funciona?</span><br />
<br />
Sim. Testei nos ambientes problemáticos e continua funcionando. Sem aquele erro de socket. Sem aquela brincadeira de SSL.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Links</span><br />
<br />
GitHub: <a href="https://github.com/NullSablex/mysql_samp" target="_blank" rel="noopener" class="mycode_url">https://github.com/NullSablex/mysql_samp</a><br />
Releases: <a href="https://github.com/NullSablex/mysql_samp/releases" target="_blank" rel="noopener" class="mycode_url">https://github.com/NullSablex/mysql_samp/releases</a><br />
<br />
Se alguém tá com o mesmo problema, talvez ajude.</div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[samp-uuid-rs]]></title>
			<link>https://forum.open.mp/showthread.php?tid=2161</link>
			<pubDate>Sat, 10 Jul 2021 14:20:00 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=804">Carlos</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=2161</guid>
			<description><![CDATA[<span style="color: #FF4700;" class="mycode_color"><span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">samp-uuid-rs</span></span></span><br />
<br />
<br />
<br />
<a href="https://github.com/carlos-menezes/samp-uuid-rs" target="_blank" rel="noopener" class="mycode_url"><img src="https://img.shields.io/badge/sampctl-samp--uuid--rs-2f2f2f.svg?style=for-the-badge" loading="lazy"  alt="[Image: sampctl-samp--uuid--rs-2f2f2f.svg?style=for-the-badge]" class="mycode_img" /></a><br />
<br />
<br />
<br />
This library provides a <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random" target="_blank" rel="noopener" class="mycode_url">UUID v4</a>?generator function.<br />
<br />
<br />
<br />
UUIDs are generally used for identifying information that needs to be unique within a system or network thereof. Their uniqueness and low probability in being repeated makes them useful for being associative keys in databases and identifiers for physical hardware within an organization.<br />
<br />
<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Installation</span></span></span><br />
<br />
<br />
<br />
Simply install to your project:<br />
<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sampctl package install carlos-menezes/samp-uuid-rs</code></div></div><br />
<br />
<br />
Include in your code and begin using the library:<br />
<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="font-family: Courier New;" class="mycode_font"><br />
<br />
<span style="color: Blue;" class="mycode_color">#include &lt;uuid&gt;</span><br />
<br />
</span></blockquote>
<br />
<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Usage</span></span></span><br />
<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>new dest[UUID_LEN];<br />
<br />
UUID(dest);<br />
<br />
printf("%s", dest); // xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx</code></div></div><br />
<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Build</span></span></span><br />
<br />
<br />
<br />
To build, run:<br />
<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>make build</code></div></div><br />
<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Testing</span></span></span><br />
<br />
<br />
<br />
To test, run:<br />
<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>make test</code></div></div>]]></description>
			<content:encoded><![CDATA[<span style="color: #FF4700;" class="mycode_color"><span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">samp-uuid-rs</span></span></span><br />
<br />
<br />
<br />
<a href="https://github.com/carlos-menezes/samp-uuid-rs" target="_blank" rel="noopener" class="mycode_url"><img src="https://img.shields.io/badge/sampctl-samp--uuid--rs-2f2f2f.svg?style=for-the-badge" loading="lazy"  alt="[Image: sampctl-samp--uuid--rs-2f2f2f.svg?style=for-the-badge]" class="mycode_img" /></a><br />
<br />
<br />
<br />
This library provides a <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random" target="_blank" rel="noopener" class="mycode_url">UUID v4</a>?generator function.<br />
<br />
<br />
<br />
UUIDs are generally used for identifying information that needs to be unique within a system or network thereof. Their uniqueness and low probability in being repeated makes them useful for being associative keys in databases and identifiers for physical hardware within an organization.<br />
<br />
<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Installation</span></span></span><br />
<br />
<br />
<br />
Simply install to your project:<br />
<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sampctl package install carlos-menezes/samp-uuid-rs</code></div></div><br />
<br />
<br />
Include in your code and begin using the library:<br />
<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="font-family: Courier New;" class="mycode_font"><br />
<br />
<span style="color: Blue;" class="mycode_color">#include &lt;uuid&gt;</span><br />
<br />
</span></blockquote>
<br />
<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Usage</span></span></span><br />
<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>new dest[UUID_LEN];<br />
<br />
UUID(dest);<br />
<br />
printf("%s", dest); // xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx</code></div></div><br />
<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Build</span></span></span><br />
<br />
<br />
<br />
To build, run:<br />
<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>make build</code></div></div><br />
<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Testing</span></span></span><br />
<br />
<br />
<br />
To test, run:<br />
<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>make test</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SampSharp - Write game modes in .NET Core]]></title>
			<link>https://forum.open.mp/showthread.php?tid=1193</link>
			<pubDate>Mon, 28 Sep 2020 21:06:38 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=846">tim</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=1193</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><img src="https://raw.githubusercontent.com/ikkentim/SampSharp/master/sampsharp.png" loading="lazy"  alt="[Image: sampsharp.png]" class="mycode_img" /></div>
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">SampSharp</span></span></div>
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><a href="https://github.com/ikkentim/SampSharp/stargazers" target="_blank" rel="noopener" class="mycode_url"><img src="https://img.shields.io/github/stars/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /></a><a href="https://github.com/ikkentim/SampSharp/network" target="_blank" rel="noopener" class="mycode_url"> <img src="https://img.shields.io/github/forks/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /></a><a href="https://github.com/ikkentim/SampSharp/issues" target="_blank" rel="noopener" class="mycode_url"> <img src="https://img.shields.io/github/issues/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /></a><a href="https://github.com/ikkentim/SampSharp/releases" target="_blank" rel="noopener" class="mycode_url"> <img src="https://img.shields.io/github/downloads/ikkentim/SampSharp/total.svg" loading="lazy"  alt="[Image: total.svg]" class="mycode_img" /><br />
<br />
</a></div>
<br />
<div style="text-align: center;" class="mycode_align"><a href="https://discord.gg/gwcHpqp" target="_blank" rel="noopener" class="mycode_url"><span style="color: #0074D9;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Join us on Discord</span></span></span></a></div>
<br />
<br />
<br />
SampSharp is a plugin and library which allows you to write SA-MP game modes in C#. The plugin works both on Linux and Windows. The library contains various classes for every type of resource available in SA-MP (players, vehicles, textdraws, etc). Aside from this wrapper around native functions, the library also contains a good structure to build your gamemode on. This plugin was initially released in 2014, and has received a good ever since and I'm still available for any questions related to this plugin.<br />
<br />
<br />
<br />
SampSharp provides two structures for developing game modes. SampSharp.GameMode and SampSharp.Entities.<br />
<br />
<br />
<br />
SampSharp.GameMode provides a simple object-oriented structure for developing your game mode. All callbacks are forwarded to the implementation of BaseMode and vanilla callbacks are forwarded as events to the related instances (eg. OnPlayerText fires the PlayerText event on the related Player instance). A simple code sample can be found below.<br />
<br />
<br />
<br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">public&nbsp;class&nbsp;</span><span style="color: #0000BB">GameMode&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">BaseMode<br /><br /></span><span style="color: #007700">{<br /><br />?&nbsp;?&nbsp;protected&nbsp;</span><span style="color: #0000BB">override&nbsp;void&nbsp;OnPlayerConnected</span><span style="color: #007700">(</span><span style="color: #0000BB">BasePlayer&nbsp;player</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">EventArgs&nbsp;e</span><span style="color: #007700">)<br /><br />?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">base</span><span style="color: #007700">.</span><span style="color: #0000BB">OnPlayerConnected</span><span style="color: #007700">(</span><span style="color: #0000BB">player</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">e</span><span style="color: #007700">);<br /><br /><br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(&#36;</span><span style="color: #DD0000">"Welcome&nbsp;{player.Name},&nbsp;to&nbsp;a&nbsp;whole&nbsp;new&nbsp;world!"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;}<br /><br /><br /><br />?&nbsp;?&nbsp;[</span><span style="color: #0000BB">Command</span><span style="color: #007700">(</span><span style="color: #DD0000">"spawn"</span><span style="color: #007700">)]<br /><br />?&nbsp;?&nbsp;public&nbsp;static&nbsp;</span><span style="color: #0000BB">void&nbsp;VehicleCommand</span><span style="color: #007700">(</span><span style="color: #0000BB">BasePlayer&nbsp;player</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">VehicleModelType&nbsp;model</span><span style="color: #007700">)<br /><br />?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">Console</span><span style="color: #007700">.</span><span style="color: #0000BB">WriteLine</span><span style="color: #007700">(&#36;</span><span style="color: #DD0000">"Spawning&nbsp;a&nbsp;{model}&nbsp;for&nbsp;{player.Name}"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;var&nbsp;</span><span style="color: #0000BB">vehicle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">GtaVehicle</span><span style="color: #007700">.</span><span style="color: #0000BB">Create</span><span style="color: #007700">(</span><span style="color: #0000BB">model</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">Position&nbsp;&nbsp;</span><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">Vector3</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.5f</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">Rotation</span><span style="color: #007700">.</span><span style="color: #0000BB">Z</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">PutInVehicle</span><span style="color: #007700">(</span><span style="color: #0000BB">vehicle</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">Color</span><span style="color: #007700">.</span><span style="color: #0000BB">GreenYellow</span><span style="color: #007700">,&nbsp;&#36;</span><span style="color: #DD0000">"You&nbsp;have&nbsp;spawned&nbsp;a&nbsp;{model}!"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;}<br /><br />}&nbsp;<br /></span></code></div></div></div><br />
<br />
<br />
SampSharp.Entities (only available since early 2020) provides an Entity-Component-System structure with full dependency injection support for developing your game mode. SampSharp.Entities is still in active development but is already stable and usable. Below, a similar code sample can be found:<br />
<br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">?&nbsp;?&nbsp;public&nbsp;class&nbsp;</span><span style="color: #0000BB">SampleSystem&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">ISystem<br /><br /></span><span style="color: #007700">?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;[</span><span style="color: #0000BB">Event</span><span style="color: #007700">]<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;public&nbsp;</span><span style="color: #0000BB">void&nbsp;OnPlayerConnected</span><span style="color: #007700">(</span><span style="color: #0000BB">Player&nbsp;player</span><span style="color: #007700">)<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(&#36;</span><span style="color: #DD0000">"Welcome&nbsp;{player.Name},&nbsp;to&nbsp;a&nbsp;whole&nbsp;new&nbsp;world!"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;}<br /><br /><br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;[</span><span style="color: #0000BB">PlayerCommand</span><span style="color: #007700">(</span><span style="color: #DD0000">"spawn"</span><span style="color: #007700">)]<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;public&nbsp;static&nbsp;</span><span style="color: #0000BB">void&nbsp;VehicleCommand</span><span style="color: #007700">(</span><span style="color: #0000BB">Player&nbsp;player</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">VehicleModelType&nbsp;model</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IWorldService&nbsp;worldService</span><span style="color: #007700">)<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">Console</span><span style="color: #007700">.</span><span style="color: #0000BB">WriteLine</span><span style="color: #007700">(&#36;</span><span style="color: #DD0000">"Spawning&nbsp;a&nbsp;{model}&nbsp;for&nbsp;{player.Name}"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;var&nbsp;</span><span style="color: #0000BB">vehicle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">worldService</span><span style="color: #007700">.</span><span style="color: #0000BB">CreateVehicle</span><span style="color: #007700">(</span><span style="color: #0000BB">model</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">Position&nbsp;&nbsp;</span><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">Vector3</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.5f</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">Rotation</span><span style="color: #007700">.</span><span style="color: #0000BB">Z</span><span style="color: #007700">,&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">PutInVehicle</span><span style="color: #007700">(</span><span style="color: #0000BB">vehicle</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">Color</span><span style="color: #007700">.</span><span style="color: #0000BB">GreenYellow</span><span style="color: #007700">,&nbsp;&#36;</span><span style="color: #DD0000">"You&nbsp;have&nbsp;spawned&nbsp;a&nbsp;{model}!"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;}<br /><br />?&nbsp;?&nbsp;}&nbsp;<br /></span></code></div></div></div><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Download</span></span><br />
<br />
<br />
<br />
Stable version: <a href="https://github.com/ikkentim/SampSharp/releases" target="_blank" rel="noopener" class="mycode_url"><img src="https://img.shields.io/github/release/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /> <img src="https://img.shields.io/github/downloads/ikkentim/SampSharp/latest/total.svg" loading="lazy"  alt="[Image: total.svg]" class="mycode_img" /></a><br />
<br />
Unstable version: <a href="https://github.com/ikkentim/SampSharp/releases" target="_blank" rel="noopener" class="mycode_url"><img src="https://img.shields.io/github/tag/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /></a><br />
<br />
<br />
<br />
<a href="https://github.com/ikkentim/SampSharp/releases" target="_blank" rel="noopener" class="mycode_url">https://github.com/ikkentim/SampSharp/releases</a><br />
<br />
<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Documentation</span></span><br />
<br />
<br />
<br />
Our documentation website is still in development and some vital documentation is still lacking. If you need any assistance, feel free to join our Discord server!<br />
<br />
<br />
<br />
<a href="https://sampsharp.net" target="_blank" rel="noopener" class="mycode_url">https://sampsharp.net</a>]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><img src="https://raw.githubusercontent.com/ikkentim/SampSharp/master/sampsharp.png" loading="lazy"  alt="[Image: sampsharp.png]" class="mycode_img" /></div>
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">SampSharp</span></span></div>
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><a href="https://github.com/ikkentim/SampSharp/stargazers" target="_blank" rel="noopener" class="mycode_url"><img src="https://img.shields.io/github/stars/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /></a><a href="https://github.com/ikkentim/SampSharp/network" target="_blank" rel="noopener" class="mycode_url"> <img src="https://img.shields.io/github/forks/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /></a><a href="https://github.com/ikkentim/SampSharp/issues" target="_blank" rel="noopener" class="mycode_url"> <img src="https://img.shields.io/github/issues/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /></a><a href="https://github.com/ikkentim/SampSharp/releases" target="_blank" rel="noopener" class="mycode_url"> <img src="https://img.shields.io/github/downloads/ikkentim/SampSharp/total.svg" loading="lazy"  alt="[Image: total.svg]" class="mycode_img" /><br />
<br />
</a></div>
<br />
<div style="text-align: center;" class="mycode_align"><a href="https://discord.gg/gwcHpqp" target="_blank" rel="noopener" class="mycode_url"><span style="color: #0074D9;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Join us on Discord</span></span></span></a></div>
<br />
<br />
<br />
SampSharp is a plugin and library which allows you to write SA-MP game modes in C#. The plugin works both on Linux and Windows. The library contains various classes for every type of resource available in SA-MP (players, vehicles, textdraws, etc). Aside from this wrapper around native functions, the library also contains a good structure to build your gamemode on. This plugin was initially released in 2014, and has received a good ever since and I'm still available for any questions related to this plugin.<br />
<br />
<br />
<br />
SampSharp provides two structures for developing game modes. SampSharp.GameMode and SampSharp.Entities.<br />
<br />
<br />
<br />
SampSharp.GameMode provides a simple object-oriented structure for developing your game mode. All callbacks are forwarded to the implementation of BaseMode and vanilla callbacks are forwarded as events to the related instances (eg. OnPlayerText fires the PlayerText event on the related Player instance). A simple code sample can be found below.<br />
<br />
<br />
<br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">public&nbsp;class&nbsp;</span><span style="color: #0000BB">GameMode&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">BaseMode<br /><br /></span><span style="color: #007700">{<br /><br />?&nbsp;?&nbsp;protected&nbsp;</span><span style="color: #0000BB">override&nbsp;void&nbsp;OnPlayerConnected</span><span style="color: #007700">(</span><span style="color: #0000BB">BasePlayer&nbsp;player</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">EventArgs&nbsp;e</span><span style="color: #007700">)<br /><br />?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">base</span><span style="color: #007700">.</span><span style="color: #0000BB">OnPlayerConnected</span><span style="color: #007700">(</span><span style="color: #0000BB">player</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">e</span><span style="color: #007700">);<br /><br /><br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(&#36;</span><span style="color: #DD0000">"Welcome&nbsp;{player.Name},&nbsp;to&nbsp;a&nbsp;whole&nbsp;new&nbsp;world!"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;}<br /><br /><br /><br />?&nbsp;?&nbsp;[</span><span style="color: #0000BB">Command</span><span style="color: #007700">(</span><span style="color: #DD0000">"spawn"</span><span style="color: #007700">)]<br /><br />?&nbsp;?&nbsp;public&nbsp;static&nbsp;</span><span style="color: #0000BB">void&nbsp;VehicleCommand</span><span style="color: #007700">(</span><span style="color: #0000BB">BasePlayer&nbsp;player</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">VehicleModelType&nbsp;model</span><span style="color: #007700">)<br /><br />?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">Console</span><span style="color: #007700">.</span><span style="color: #0000BB">WriteLine</span><span style="color: #007700">(&#36;</span><span style="color: #DD0000">"Spawning&nbsp;a&nbsp;{model}&nbsp;for&nbsp;{player.Name}"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;var&nbsp;</span><span style="color: #0000BB">vehicle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">GtaVehicle</span><span style="color: #007700">.</span><span style="color: #0000BB">Create</span><span style="color: #007700">(</span><span style="color: #0000BB">model</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">Position&nbsp;&nbsp;</span><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">Vector3</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.5f</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">Rotation</span><span style="color: #007700">.</span><span style="color: #0000BB">Z</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">PutInVehicle</span><span style="color: #007700">(</span><span style="color: #0000BB">vehicle</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">Color</span><span style="color: #007700">.</span><span style="color: #0000BB">GreenYellow</span><span style="color: #007700">,&nbsp;&#36;</span><span style="color: #DD0000">"You&nbsp;have&nbsp;spawned&nbsp;a&nbsp;{model}!"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;}<br /><br />}&nbsp;<br /></span></code></div></div></div><br />
<br />
<br />
SampSharp.Entities (only available since early 2020) provides an Entity-Component-System structure with full dependency injection support for developing your game mode. SampSharp.Entities is still in active development but is already stable and usable. Below, a similar code sample can be found:<br />
<br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">?&nbsp;?&nbsp;public&nbsp;class&nbsp;</span><span style="color: #0000BB">SampleSystem&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">ISystem<br /><br /></span><span style="color: #007700">?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;[</span><span style="color: #0000BB">Event</span><span style="color: #007700">]<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;public&nbsp;</span><span style="color: #0000BB">void&nbsp;OnPlayerConnected</span><span style="color: #007700">(</span><span style="color: #0000BB">Player&nbsp;player</span><span style="color: #007700">)<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(&#36;</span><span style="color: #DD0000">"Welcome&nbsp;{player.Name},&nbsp;to&nbsp;a&nbsp;whole&nbsp;new&nbsp;world!"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;}<br /><br /><br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;[</span><span style="color: #0000BB">PlayerCommand</span><span style="color: #007700">(</span><span style="color: #DD0000">"spawn"</span><span style="color: #007700">)]<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;public&nbsp;static&nbsp;</span><span style="color: #0000BB">void&nbsp;VehicleCommand</span><span style="color: #007700">(</span><span style="color: #0000BB">Player&nbsp;player</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">VehicleModelType&nbsp;model</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IWorldService&nbsp;worldService</span><span style="color: #007700">)<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;{<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">Console</span><span style="color: #007700">.</span><span style="color: #0000BB">WriteLine</span><span style="color: #007700">(&#36;</span><span style="color: #DD0000">"Spawning&nbsp;a&nbsp;{model}&nbsp;for&nbsp;{player.Name}"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;var&nbsp;</span><span style="color: #0000BB">vehicle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">worldService</span><span style="color: #007700">.</span><span style="color: #0000BB">CreateVehicle</span><span style="color: #007700">(</span><span style="color: #0000BB">model</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">Position&nbsp;&nbsp;</span><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">Vector3</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.5f</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">Rotation</span><span style="color: #007700">.</span><span style="color: #0000BB">Z</span><span style="color: #007700">,&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">PutInVehicle</span><span style="color: #007700">(</span><span style="color: #0000BB">vehicle</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">.</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">Color</span><span style="color: #007700">.</span><span style="color: #0000BB">GreenYellow</span><span style="color: #007700">,&nbsp;&#36;</span><span style="color: #DD0000">"You&nbsp;have&nbsp;spawned&nbsp;a&nbsp;{model}!"</span><span style="color: #007700">);<br /><br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;}<br /><br />?&nbsp;?&nbsp;}&nbsp;<br /></span></code></div></div></div><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Download</span></span><br />
<br />
<br />
<br />
Stable version: <a href="https://github.com/ikkentim/SampSharp/releases" target="_blank" rel="noopener" class="mycode_url"><img src="https://img.shields.io/github/release/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /> <img src="https://img.shields.io/github/downloads/ikkentim/SampSharp/latest/total.svg" loading="lazy"  alt="[Image: total.svg]" class="mycode_img" /></a><br />
<br />
Unstable version: <a href="https://github.com/ikkentim/SampSharp/releases" target="_blank" rel="noopener" class="mycode_url"><img src="https://img.shields.io/github/tag/ikkentim/SampSharp.svg" loading="lazy"  alt="[Image: SampSharp.svg]" class="mycode_img" /></a><br />
<br />
<br />
<br />
<a href="https://github.com/ikkentim/SampSharp/releases" target="_blank" rel="noopener" class="mycode_url">https://github.com/ikkentim/SampSharp/releases</a><br />
<br />
<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Documentation</span></span><br />
<br />
<br />
<br />
Our documentation website is still in development and some vital documentation is still lacking. If you need any assistance, feel free to join our Discord server!<br />
<br />
<br />
<br />
<a href="https://sampsharp.net" target="_blank" rel="noopener" class="mycode_url">https://sampsharp.net</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Streamer Plugin by Incognito]]></title>
			<link>https://forum.open.mp/showthread.php?tid=664</link>
			<pubDate>Fri, 21 Jun 2019 06:14:18 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=340">Sasino97</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=664</guid>
			<description><![CDATA[Since Incognito does not use these forums and since his Streamer plugin is very important to the community, I am re-posting his thread here.<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="font-size: x-large;" class="mycode_size">Streamer Plugin</span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: medium;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">This plugin streams objects, pickups, checkpoints, race checkpoints, map icons, and 3D text labels at user-defined server ticks. Basic area detection is also included. Because it is written entirely in C, much of the overhead from PAWN is avoided. This streamer, as a result, is quite a bit faster than any other implementation currently available in PAWN.</span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: large;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">Changelog</span></span></span></span><br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/samp-incognito/samp-streamer-plugin/commits/master" target="_blank" rel="noopener" class="mycode_url"><span style="color: #1a425f;" class="mycode_color">GitHub Commit History</span></a></span></span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: medium;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">Refer to the CHANGES file the binary package for the full changelog.</span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: large;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">Documentation</span></span></span></span><br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/samp-incognito/samp-streamer-plugin/wiki" target="_blank" rel="noopener" class="mycode_url"><span style="color: #1a425f;" class="mycode_color">GitHub Wiki</span></a></span></span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: medium;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">Additional information can be found by searching this thread.</span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: large;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">Download</span></span></span></span><br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/samp-incognito/samp-streamer-plugin/releases/latest" target="_blank" rel="noopener" class="mycode_url"><span style="color: #1a425f;" class="mycode_color">GitHub Releases Page</span></a></span></span></span></span><br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">The Windows version requires the?</span></span><a href="https://www.microsoft.com/en-us/download/details.aspx?id=48145" target="_blank" rel="noopener" class="mycode_url"><span style="color: #1a425f;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">Microsoft Visual C 2015 Redistributable Package</span></span></a><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">.</span></span></span></blockquote>
]]></description>
			<content:encoded><![CDATA[Since Incognito does not use these forums and since his Streamer plugin is very important to the community, I am re-posting his thread here.<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="font-size: x-large;" class="mycode_size">Streamer Plugin</span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: medium;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">This plugin streams objects, pickups, checkpoints, race checkpoints, map icons, and 3D text labels at user-defined server ticks. Basic area detection is also included. Because it is written entirely in C, much of the overhead from PAWN is avoided. This streamer, as a result, is quite a bit faster than any other implementation currently available in PAWN.</span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: large;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">Changelog</span></span></span></span><br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/samp-incognito/samp-streamer-plugin/commits/master" target="_blank" rel="noopener" class="mycode_url"><span style="color: #1a425f;" class="mycode_color">GitHub Commit History</span></a></span></span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: medium;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">Refer to the CHANGES file the binary package for the full changelog.</span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: large;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">Documentation</span></span></span></span><br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/samp-incognito/samp-streamer-plugin/wiki" target="_blank" rel="noopener" class="mycode_url"><span style="color: #1a425f;" class="mycode_color">GitHub Wiki</span></a></span></span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: medium;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">Additional information can be found by searching this thread.</span></span></span><br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: large;" class="mycode_size"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">Download</span></span></span></span><br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/samp-incognito/samp-streamer-plugin/releases/latest" target="_blank" rel="noopener" class="mycode_url"><span style="color: #1a425f;" class="mycode_color">GitHub Releases Page</span></a></span></span></span></span><br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">The Windows version requires the?</span></span><a href="https://www.microsoft.com/en-us/download/details.aspx?id=48145" target="_blank" rel="noopener" class="mycode_url"><span style="color: #1a425f;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">Microsoft Visual C 2015 Redistributable Package</span></span></a><span style="color: #000000;" class="mycode_color"><span style="font-family: verdana, geneva, lucida,;" class="mycode_font">.</span></span></span></blockquote>
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[samp-precise-timers ?: A timer plugin written in Rust]]></title>
			<link>https://forum.open.mp/showthread.php?tid=576</link>
			<pubDate>Tue, 21 May 2019 05:36:34 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=1102">bmisiak</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=576</guid>
			<description><![CDATA[<span style="font-size: x-large;" class="mycode_size">samp-precise-timers ⌚</span><br />
<a href="https://github.com/bmisiak/samp-precise-timers" target="_blank" rel="noopener" class="mycode_url">github.com/bmisiak/samp-precise-timers</a><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size">Briefly</span><br />
Developed for <a href="https://net4game.com/index" target="_blank" rel="noopener" class="mycode_url">net4game.com</a> (RolePlay), this plugin provides precise timers for the server. It is written in Rust, a memory-safe language.<br />
<br />
<span style="font-size: medium;" class="mycode_size">Why rewrite timers?</span><br />
I had a lot of safety concerns with some of the existing solutions. They weren't written with data integrity, memory safety or preventing server crashes in mind and seemed to have quite a few bugs. As privacy and safety is our primary concern at net4game, I wrote this in Rust, which combines high-level ergonomics with the performance of a low-level language. ⚡<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Please check out the code</span> to see the benefits. You might like Rust a lot. The code is much simpler than C++ equivalents, especially the ones which still use *char, free() and delete[] instead of modern C++ idioms such as std::unique_ptr, but as Rust has no runtime, there is no overhead 😉<br />
<br />
<span style="font-size: medium;" class="mycode_size">We would like your help! 💃</span><br />
Oh, and if you enjoy working on servers, we are looking for a team to help our international expansion. 🎉  net4game has been around for a decade as the biggest Polish server. We introduced a lot of innovations over the years and we are almost ready to become international. Shoot me an e-mail at <a href="mailto:bm+code@net4game.com" class="mycode_email">bm+code@net4game.com</a> if you're interested.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><a href="https://github.com/bmisiak/samp-precise-timers/releases" target="_blank" rel="noopener" class="mycode_url">Downloads on GitHub</a></span><br />
Also available on sampctl as <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>bmisiak/samp-precise-timers</code></div></div><br />
On top of all of the above, I would love to help with developing open.mp!]]></description>
			<content:encoded><![CDATA[<span style="font-size: x-large;" class="mycode_size">samp-precise-timers ⌚</span><br />
<a href="https://github.com/bmisiak/samp-precise-timers" target="_blank" rel="noopener" class="mycode_url">github.com/bmisiak/samp-precise-timers</a><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size">Briefly</span><br />
Developed for <a href="https://net4game.com/index" target="_blank" rel="noopener" class="mycode_url">net4game.com</a> (RolePlay), this plugin provides precise timers for the server. It is written in Rust, a memory-safe language.<br />
<br />
<span style="font-size: medium;" class="mycode_size">Why rewrite timers?</span><br />
I had a lot of safety concerns with some of the existing solutions. They weren't written with data integrity, memory safety or preventing server crashes in mind and seemed to have quite a few bugs. As privacy and safety is our primary concern at net4game, I wrote this in Rust, which combines high-level ergonomics with the performance of a low-level language. ⚡<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Please check out the code</span> to see the benefits. You might like Rust a lot. The code is much simpler than C++ equivalents, especially the ones which still use *char, free() and delete[] instead of modern C++ idioms such as std::unique_ptr, but as Rust has no runtime, there is no overhead 😉<br />
<br />
<span style="font-size: medium;" class="mycode_size">We would like your help! 💃</span><br />
Oh, and if you enjoy working on servers, we are looking for a team to help our international expansion. 🎉  net4game has been around for a decade as the biggest Polish server. We introduced a lot of innovations over the years and we are almost ready to become international. Shoot me an e-mail at <a href="mailto:bm+code@net4game.com" class="mycode_email">bm+code@net4game.com</a> if you're interested.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><a href="https://github.com/bmisiak/samp-precise-timers/releases" target="_blank" rel="noopener" class="mycode_url">Downloads on GitHub</a></span><br />
Also available on sampctl as <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>bmisiak/samp-precise-timers</code></div></div><br />
On top of all of the above, I would love to help with developing open.mp!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[pawn env]]></title>
			<link>https://forum.open.mp/showthread.php?tid=552</link>
			<pubDate>Sun, 12 May 2019 15:41:18 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=20">dakyskye</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=552</guid>
			<description><![CDATA[<span style="color: #FF4700;" class="mycode_color"><span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">pawn-env</span></span></span><br />
<br />
<a href="https://github.com/dakyskye/pawn-env" target="_blank" rel="noopener" class="mycode_url"><img src="https://shields.southcla.ws/badge/sampctl-pawn--env-2f2f2f.svg?style=for-the-badge" loading="lazy"  alt="[Image: sampctl-pawn--env-2f2f2f.svg?style=for-the-badge]" class="mycode_img" /></a><br />
<br />
Access environment variables in PAWN<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Installation</span></span></span><br />
<br />
Install to your project:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sampctl package install dakyskye/pawn-env</code></div></div><br />
include in your code:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;env&gt;</code></div></div><br />
and start using it.<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Usage</span></span></span><br />
<br />
At development time, you can use <span style="font-family: courier new;" class="mycode_font">.env</span> file, but in production it’s not recommended.<br />
<br />
<span style="color: SlateGray;" class="mycode_color"><span style="font-size: medium;" class="mycode_size">Example <span style="font-family: courier new;" class="mycode_font">.env</span> file content:</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>MYSQL_USER=user<br />
MYSQL_PASSWORD=password<br />
MYSQL_HOST=localhost<br />
MYSQL_DATABASE=database</code></div></div><br />
<span style="color: SlateGray;" class="mycode_color"><span style="font-size: medium;" class="mycode_size">Using it in the recommended way:</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>MYSQL_USER=user MYSQL_PASSWORD=password MYSQL_HOST=localhost MYSQL_DATABASE=database sampctl package run</code></div></div><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36;env:MYSQL_USER="user"; &#36;env:MYSQL_PASSWORD="password"; &#36;env:MYSQL_HOST="localhost"; &#36;env:MYSQL_DATABASE="database"; sampctl package run</code></div></div><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>docker run -d &#92;<br />
    -e MYSQL_USER=user &#92;<br />
    -e MYSQL_PASSWORD=password &#92;<br />
    -e MYSQL_HOST=localhost &#92;<br />
    -e MYSQL_DATABASE=database &#92;<br />
    --name my-container my/image</code></div></div><br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">API</span></span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>native bool:Env_Has(const env[]);<br />
native bool:Env_Get(const env[], dest[], size=sizeof(dest));</code></div></div><ul class="mycode_list"><li><span style="font-family: courier new;" class="mycode_font">bool:Env_Has(const env[]);</span><br />
</li>
</ul>
It checks if an environment variable with passed name as <span style="font-family: courier new;" class="mycode_font">env</span> exists or not and returns the result as <span style="font-family: courier new;" class="mycode_font">true</span> or <span style="font-family: courier new;" class="mycode_font">false</span>, hence the <span style="font-family: courier new;" class="mycode_font">bool</span> tag.<br />
<ul class="mycode_list"><li><span style="font-family: courier new;" class="mycode_font">bool:Env_Get(const env[], dest[], size=sizeof(dest));</span><br />
</li>
</ul>
It reads the value of the environment variable of passed name as <span style="font-family: courier new;" class="mycode_font">env</span>, then packs it into <span style="font-family: courier new;" class="mycode_font">dest</span>.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Example usage</span> can be found in <a href="https://github.com/dakyskye/pawn-env/tree/master/tests/tests.pwn" target="_blank" rel="noopener" class="mycode_url">tests/tests.pwn</a><br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Building</span></span></span><br />
<br />
First of all, install GNU Make if you haven’t already.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>make build</code></div></div><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>docker build -t pawn-env .<br />
docker run -v DISKLETTER:&#92;path&#92;to&#92;pawn-env&#92;plugins:/pawn-env/plugins --name pawn-env pawn-env</code></div></div><br />
An example path from my case: <span style="font-family: courier new;" class="mycode_font">X:\My-Workflow\pawn-env\plugins</span><br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits</span></span></span><br />
<ul class="mycode_list"><li><a href="https://github.com/Southclaws" target="_blank" rel="noopener" class="mycode_url">Southclaws</a> - for inspiration (see his <a href="https://github.com/Southclaws/pawn-env" target="_blank" rel="noopener" class="mycode_url">pawn-env</a>)<br />
</li>
<li><a href="https://github.com/Sreyas-Sreelal" target="_blank" rel="noopener" class="mycode_url">SyS</a> - for <a href="https://github.com/Sreyas-Sreelal/rs-plugin-boilerplate" target="_blank" rel="noopener" class="mycode_url">boilerplate</a><br />
</li>
<li><a href="https://github.com/ZOTTCE" target="_blank" rel="noopener" class="mycode_url">ZOTTCE</a> - for <a href="https://github.com/ZOTTCE/samp-rs" target="_blank" rel="noopener" class="mycode_url">samp-rs</a><br />
</li>
</ul>
]]></description>
			<content:encoded><![CDATA[<span style="color: #FF4700;" class="mycode_color"><span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">pawn-env</span></span></span><br />
<br />
<a href="https://github.com/dakyskye/pawn-env" target="_blank" rel="noopener" class="mycode_url"><img src="https://shields.southcla.ws/badge/sampctl-pawn--env-2f2f2f.svg?style=for-the-badge" loading="lazy"  alt="[Image: sampctl-pawn--env-2f2f2f.svg?style=for-the-badge]" class="mycode_img" /></a><br />
<br />
Access environment variables in PAWN<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Installation</span></span></span><br />
<br />
Install to your project:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sampctl package install dakyskye/pawn-env</code></div></div><br />
include in your code:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;env&gt;</code></div></div><br />
and start using it.<br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Usage</span></span></span><br />
<br />
At development time, you can use <span style="font-family: courier new;" class="mycode_font">.env</span> file, but in production it’s not recommended.<br />
<br />
<span style="color: SlateGray;" class="mycode_color"><span style="font-size: medium;" class="mycode_size">Example <span style="font-family: courier new;" class="mycode_font">.env</span> file content:</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>MYSQL_USER=user<br />
MYSQL_PASSWORD=password<br />
MYSQL_HOST=localhost<br />
MYSQL_DATABASE=database</code></div></div><br />
<span style="color: SlateGray;" class="mycode_color"><span style="font-size: medium;" class="mycode_size">Using it in the recommended way:</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>MYSQL_USER=user MYSQL_PASSWORD=password MYSQL_HOST=localhost MYSQL_DATABASE=database sampctl package run</code></div></div><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36;env:MYSQL_USER="user"; &#36;env:MYSQL_PASSWORD="password"; &#36;env:MYSQL_HOST="localhost"; &#36;env:MYSQL_DATABASE="database"; sampctl package run</code></div></div><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>docker run -d &#92;<br />
    -e MYSQL_USER=user &#92;<br />
    -e MYSQL_PASSWORD=password &#92;<br />
    -e MYSQL_HOST=localhost &#92;<br />
    -e MYSQL_DATABASE=database &#92;<br />
    --name my-container my/image</code></div></div><br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">API</span></span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>native bool:Env_Has(const env[]);<br />
native bool:Env_Get(const env[], dest[], size=sizeof(dest));</code></div></div><ul class="mycode_list"><li><span style="font-family: courier new;" class="mycode_font">bool:Env_Has(const env[]);</span><br />
</li>
</ul>
It checks if an environment variable with passed name as <span style="font-family: courier new;" class="mycode_font">env</span> exists or not and returns the result as <span style="font-family: courier new;" class="mycode_font">true</span> or <span style="font-family: courier new;" class="mycode_font">false</span>, hence the <span style="font-family: courier new;" class="mycode_font">bool</span> tag.<br />
<ul class="mycode_list"><li><span style="font-family: courier new;" class="mycode_font">bool:Env_Get(const env[], dest[], size=sizeof(dest));</span><br />
</li>
</ul>
It reads the value of the environment variable of passed name as <span style="font-family: courier new;" class="mycode_font">env</span>, then packs it into <span style="font-family: courier new;" class="mycode_font">dest</span>.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Example usage</span> can be found in <a href="https://github.com/dakyskye/pawn-env/tree/master/tests/tests.pwn" target="_blank" rel="noopener" class="mycode_url">tests/tests.pwn</a><br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Building</span></span></span><br />
<br />
First of all, install GNU Make if you haven’t already.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>make build</code></div></div><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>docker build -t pawn-env .<br />
docker run -v DISKLETTER:&#92;path&#92;to&#92;pawn-env&#92;plugins:/pawn-env/plugins --name pawn-env pawn-env</code></div></div><br />
An example path from my case: <span style="font-family: courier new;" class="mycode_font">X:\My-Workflow\pawn-env\plugins</span><br />
<br />
<span style="color: RoyalBlue;" class="mycode_color"><span style="font-size: x-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits</span></span></span><br />
<ul class="mycode_list"><li><a href="https://github.com/Southclaws" target="_blank" rel="noopener" class="mycode_url">Southclaws</a> - for inspiration (see his <a href="https://github.com/Southclaws/pawn-env" target="_blank" rel="noopener" class="mycode_url">pawn-env</a>)<br />
</li>
<li><a href="https://github.com/Sreyas-Sreelal" target="_blank" rel="noopener" class="mycode_url">SyS</a> - for <a href="https://github.com/Sreyas-Sreelal/rs-plugin-boilerplate" target="_blank" rel="noopener" class="mycode_url">boilerplate</a><br />
</li>
<li><a href="https://github.com/ZOTTCE" target="_blank" rel="noopener" class="mycode_url">ZOTTCE</a> - for <a href="https://github.com/ZOTTCE/samp-rs" target="_blank" rel="noopener" class="mycode_url">samp-rs</a><br />
</li>
</ul>
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[sscanf]]></title>
			<link>https://forum.open.mp/showthread.php?tid=426</link>
			<pubDate>Sun, 21 Apr 2019 23:34:39 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=6">Y_Less</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=426</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf 2.8.2</span></span></span></span></span></div>
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">NPC modes</span></span></span></span></span><br />
<br />
To use sscanf in an NPC mode, download this file:<br />
<br />
<a href="http://dl.dropbox.com/u/21683085/npcdll.rar" target="_blank" rel="noopener" class="mycode_url">http://dl.dropbox.com/u/21683085/npcdll.rar</a><br />
<br />
And extract it to your root server directory (so "amxsscanf.dll" is in the same directory as "samp-npc.exe"). Then use as normal. The only tiny difference is that "u", "r", and "q" don't know if a user is a bot or not, so just assume they are all players - use accordingly.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Downloads</span></span></span></span></span><br />
<br />
GitHub repo (for sscanf 3):<br />
<br />
<a href="https://github.com/maddinat0r/sscanf/releases" target="_blank" rel="noopener" class="mycode_url">https://github.com/maddinat0r/sscanf/releases</a><br />
<br />
Source, Windows .dll, Linux .so and include:<br />
<br />
<a href="https://dl.dropboxusercontent.com/u/102595204/sscanf-2.8.2.zip" target="_blank" rel="noopener" class="mycode_url">https://dl.dropboxusercontent.com/u/1025...-2.8.2.zip</a><br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Use</span></span></span></span></span><br />
<br />
This behaves exactly as the old sscanf did, just MUCH faster and much more flexibly. To use it add:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">#include&nbsp;&lt;sscanf2&gt;&nbsp;<br /></span></code></div></div></div><br />
To your modes and remove the old sscanf (the new include will detect the old version and throw an error if it is detected). On windows add:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">plugins&nbsp;sscanf&nbsp;<br /></span></code></div></div></div><br />
To server.cfg. On Linux add:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">plugins&nbsp;sscanf</span><span style="color: #007700">.</span><span style="color: #0000BB">so&nbsp;<br /></span></code></div></div></div><br />
The basic code looks like:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ui"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">giveplayerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">amount</span><span style="color: #007700">))<br />{<br />?&nbsp;?return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF0000AA</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Usage:&nbsp;/givecash&nbsp;&lt;playerid/name&gt;&nbsp;&lt;amount&gt;"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
However it should be noted that sscanf can be used for any text processing you like. For example an ini processor could look like (don't worry about what the bits mean at this stage):<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">szFileLine</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;=&gt;s[8]s[32]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">szIniName</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">szIniValue</span><span style="color: #007700">))<br />{<br />?&nbsp;?</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Invalid&nbsp;INI&nbsp;format&nbsp;line"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
There is also an alternate function name to avoid confusion with the C standard sscanf:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ui"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">giveplayerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">amount</span><span style="color: #007700">))<br />{<br />?&nbsp;?return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF0000AA</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Usage:&nbsp;/givecash&nbsp;&lt;playerid/name&gt;&nbsp;&lt;amount&gt;"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Specifiers</span></span></span></span></span><br />
<br />
The available specifiers (the letters "u", "i" and "s" in the codes above) are below.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Basic specifiers</span></span></span></span><br />
</li>
</ul>
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Specifier(s) ? ? ? ? ? ? ? Name ? ? ? ? ? ? ? ? ? Example values<br />
? ?i, d ? ? ? ? Integer ? ? ? ? ? ? ? ? ? ? ? ? ? ?1, 42, -10<br />
? ?c ? ? ? ? ? ?Character ? ? ? ? ? ? ? ? ? ? ? ? ?a, o, *<br />
? ?l ? ? ? ? ? ?Logical ? ? ? ? ? ? ? ? ? ? ? ? ? ?true, false<br />
? ?b ? ? ? ? ? ?Binary ? ? ? ? ? ? ? ? ? ? ? ? ? ? 01001, 0b1100<br />
? ?h, x ? ? ? ? Hex ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1A, 0x23<br />
? ?o ? ? ? ? ? ?Octal ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?045 12<br />
? ?n ? ? ? ? ? ?Number ? ? ? ? ? ? ? ? ? ? ? ? ? ? 42, 0b010, 0xAC, 045<br />
? ?f ? ? ? ? ? ?Float ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.7, -99.5<br />
? ?g ? ? ? ? ? ?IEEE Float ? ? ? ? ? ? ? ? ? ? ? ? 0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E<br />
? ?u ? ? ? ? ? ?User name/id (bots and players) ? ?Y_Less, 0<br />
? ?q ? ? ? ? ? ?Bot name/id ? ? ? ? ? ? ? ? ? ? ? ?ShopBot, 27<br />
? ?r ? ? ? ? ? ?Player name/id ? ? ? ? ? ? ? ? ? ? Y_Less, 42</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Strings</span></span></span></span><br />
</li>
</ul>
<br />
<br />
The specifier "s" is used, as before, for strings - but they are now more advanced. As before they support collection, so doing:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">val</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello<br />
27</code></div></div><br />
Doing:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;there&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">val</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will fail as "there" is not a number. However doing:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;there"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello there</code></div></div><br />
Because there is nothing after "s" in the specifier, the string gets everything. To stop this simply add a space:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;there"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s&nbsp;"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello</code></div></div><br />
You can also escape parts of strings with "\\" - note that it is two backslashes as 1 is used by the compiler:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&#092;&#092;&nbsp;there&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">val</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello there<br />
27</code></div></div><br />
All these examples however will give warnings in the server as the new version has array sizes. The above code should be:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new<br />?&nbsp;?</span><span style="color: #0000BB">str</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],<br />?&nbsp;?</span><span style="color: #0000BB">val</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&#092;&#092;&nbsp;there&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s[32]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">val</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
As you can see - the format specifier now contains the length of the target string, ensuring that you can never have your strings overflow and cause problems. This can be combined with the SA:MP compiler's stringizing:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">#define&nbsp;STR_SIZE&nbsp;32<br /></span><span style="color: #007700">new<br />?&nbsp;?</span><span style="color: #0000BB">str</span><span style="color: #007700">[</span><span style="color: #0000BB">STR_SIZE</span><span style="color: #007700">],<br />?&nbsp;?</span><span style="color: #0000BB">val</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&#092;&#092;&nbsp;there&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s["&nbsp;</span><span style="color: #FF8000">#STR_SIZE&nbsp;"]i",&nbsp;str,&nbsp;val);&nbsp;<br /></span></code></div></div></div><br />
So when you change your string size you don't need to change your specifiers.<br />
<br />
What happened to "z", the optional string? z has been removed (you can still use it but will get a server warning) to make way for the new optional parameter system described later on.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Arrays</span></span></span></span><br />
</li>
</ul>
<br />
One of the advanced new specifiers is "a", which creates an array, obviously. The syntax is similar to that of strings and, as you will see later, the delimiter code:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new<br />?&nbsp;?</span><span style="color: #0000BB">arr</span><span style="color: #007700">[</span><span style="color: #0000BB">5</span><span style="color: #007700">];<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3&nbsp;4&nbsp;5"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"a&lt;i&gt;[5]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
The "a" specifier is immediately followed by a single type enclosed in angle brackets - this type can be any of the basic types listed above. It is the followed, as with strings now, by an array size. The code above will put the numbers 1 to 5 into the 5 indexes of the "arr" array variable.<br />
<br />
Arrays can now also be combined with strings (see below), specifying the string size in the array type:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;s[10]&gt;[12]</code></div></div><br />
This will produce an array of 12 strings, each up to 10 characters long (9  NULL). Optional string arrays still follow the optional array syntax:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;s[10]&gt;(hello)[12]</code></div></div><br />
However, unlike numbers you can't specify a progression and have it fill up. This code:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;i&gt;(0, 1)[4]</code></div></div><br />
Will by default produce:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>0, 1, 2, 3</code></div></div><br />
However, this code:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;s[10]&gt;(hi, there)[4]</code></div></div><br />
Will by default produce:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>"hi, there", "hi, there", "hi, there", "hi, there"</code></div></div><br />
As normal, you can add brackets in to the default string value with "\)":<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;s[10]&gt;(hi (code&#92;))[4]</code></div></div><br />
It should also be noted that there is NO length checking on default strings. If you do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;s[10]&gt;(This is longer than 10 characters)[4]</code></div></div><br />
You will probably just corrupt the PAWN stack. The length checking is to ensure no users enter malicious data; however, in this case it is up to the scripter to ensure that the data is correct as they are the only one affecting it and shouldn't be trying to crash their own server. Interestingly, arrays of strings actually also work with jagged arrays and arrays that have been shuffled by Slice's quicksort function (this isn't a side-effect, I specifically wrote them to do so).<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Enums</span></span></span></span><br />
</li>
</ul>
<br />
This is possibly the most powerful addition to sscanf ever. This gives you the ability to define the structure of an enum within your specifier string and read any data straight into it. The format takes after that of arrays, but with more types - and you can include strings in enums (but not other enums or arrays):<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">enum<br /></span><span style="color: #007700">?&nbsp;?</span><span style="color: #0000BB">E_DATA<br /></span><span style="color: #007700">{<br />?&nbsp;?</span><span style="color: #0000BB">E_DATA_C</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">E_DATA_X</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_DATA_NAME</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],<br />?&nbsp;?</span><span style="color: #0000BB">E_DATA_Z<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB">main<br /></span><span style="color: #007700">{<br />?&nbsp;?new<br />?&nbsp;?&nbsp;?&nbsp;?var[</span><span style="color: #0000BB">E_DATA</span><span style="color: #007700">];<br />?&nbsp;?</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;12.0&nbsp;Bob&nbsp;c"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"e&lt;ifs[32]c&gt;"</span><span style="color: #007700">,&nbsp;var);<br />}&nbsp;<br /></span></code></div></div></div><br />
Now I'll be impressed if you can read that code straight off, so I'll explain it slowly:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">e&nbsp;</span><span style="color: #007700">-&nbsp;</span><span style="color: #0000BB">Start&nbsp;of&nbsp;the&nbsp;</span><span style="color: #DD0000">"enum"&nbsp;</span><span style="color: #0000BB">type<br /></span><span style="color: #007700">&lt;&nbsp;-&nbsp;</span><span style="color: #0000BB">Starts&nbsp;the&nbsp;specification&nbsp;of&nbsp;the&nbsp;structure&nbsp;of&nbsp;the&nbsp;enum<br />i&nbsp;</span><span style="color: #007700">-&nbsp;</span><span style="color: #0000BB">An&nbsp;integer</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">corresponds&nbsp;with&nbsp;E_DATA_C<br />f&nbsp;</span><span style="color: #007700">-&nbsp;</span><span style="color: #0000BB">A&nbsp;float</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">corresponds&nbsp;with&nbsp;E_DATA_X<br />s</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">]&nbsp;-&nbsp;</span><span style="color: #0000BB">A&nbsp;32&nbsp;cell&nbsp;string</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">corresponds&nbsp;with&nbsp;E_DATA_NAME<br />c&nbsp;</span><span style="color: #007700">-&nbsp;</span><span style="color: #0000BB">A&nbsp;character</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">corresponds&nbsp;with&nbsp;E_DATA_Z<br /></span><span style="color: #007700">&gt;&nbsp;-&nbsp;</span><span style="color: #0000BB">End&nbsp;of&nbsp;the&nbsp;enum&nbsp;specification&nbsp;<br /></span></code></div></div></div><br />
Note that an enum doesn't require a size like arrays and strings - it's size is determined by the number and size of the types. Most, but not all, specifiers can be used inside enums (notably arrays and other enums can't be).<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Quiet</span></span></span></span><br />
</li>
</ul>
<br />
The two new specifiers "{" and "}" are used for what are known as "quiet" strings. These are strings which are read and checked, but not saved. For example:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"42&nbsp;-100"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"{i}i"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Clearly there are two numbers and two "i", but only one return variable. This is because the first "i" is quiet so is not saved, but affects the return value. The code above makes "var" "-100". The code below will fail in an if check:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hi&nbsp;-100"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"{i}i"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Although the first integer is not saved it is still read - and "hi" is not an integer. Quiet zones can be as long as you like, even for the whole string if you only want to check values are right, not save them:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"i{ii}"</span><span style="color: #007700">,&nbsp;var);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"{iii}"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"i{a&lt;i&gt;[2]}"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
You can also embed quiet sections inside enum specifications:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;12.0&nbsp;Bob&nbsp;42&nbsp;INFINITY&nbsp;c"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"e&lt;ifs[32]{ig}c&gt;"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Quiet sections cannot contain other quiet sections, however they can include enums which contain quiet sections.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Searches</span></span></span></span><br />
</li>
</ul>
<br />
Searches were in the last version of sscanf too, but I'm explaining them again anyway. Strings enclosed in single quotes (') are scanned for in the main string and the position moved on. Note that to search for a single quote you escape it as above using "\\":<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"10&nbsp;11&nbsp;woo&nbsp;12"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"i'woo'i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Gives:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>10<br />
12</code></div></div><br />
You could achieve the same effect with:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"10&nbsp;11&nbsp;woo&nbsp;12"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"i{is[1000]}i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
But that wouldn't check that the string was "woo". Also note the use of "1000" for the string size. Quiet strings must still have a length, but as they aren't saved anywhere you can make this number as large as you like to cover any eventuality. Enum specifications can include search strings.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Enums</span></span></span></span><br />
</li>
</ul>
<br />
This is a feature similar to quiet sections, which allows you to skip overwriting certain parts of an enum:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;ii-i-ii&gt;</code></div></div><br />
Here the "-" is a "minus", and tells sscanf that there is an enum element there, but not to do anything, so if you had:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">enum&nbsp;E<br /></span><span style="color: #007700">{<br />?&nbsp;?</span><span style="color: #0000BB">E_A</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_B</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_C</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_D</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_E<br /></span><span style="color: #007700">}&nbsp;<br /></span></code></div></div></div><br />
And you only wanted to update the first two and the last fields and leave all others untouched you could use that specifier above. This way sscanf knows how to skip over the memory, and how much memory to skip. Note that this doesn't read anything, so you could also combine this with quiet sections:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;ii-i-i{ii}i&gt;</code></div></div><br />
That will read two values and save them, skip over two memory locations, read two values and NOT save them, then read and save a last value. In this way you can have written down all the values for every slot in the enum, but have only used 3 of them. Note that this is the same with "E" - if you do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;ii-i-ii&gt;</code></div></div><br />
You should ONLY specify THREE defaults, not all five:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;ii-i-ii&gt;(11, 22, 55)</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Delimiters</span></span></span></span><br />
</li>
</ul>
<br />
The previous version of sscanf had "p" to change the symbol used to separate tokens. This specifier still exists but it has been formalised to match the array and enum syntax. What was previously:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1,2,3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p,iii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var2</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Is now:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1,2,3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;,&gt;iii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var2</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
The old version will still work, but it will give a warning. Enum specifications can include delimiters, and is the only time "&lt;&gt;"s are contained in other "&lt;&gt;"s:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;12.0&nbsp;Bob,c"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"e&lt;ifp&lt;,&gt;s[32]c&gt;"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Note that the delimiter will remain in effect after the enum is complete. You can even use "&gt;" as a specifier by doing "p&lt;\&gt;&gt;" (or the older "p&gt;").<br />
<br />
When used with strings, the collection behaviour is overruled. Most specifiers are still space delimited, so for example this will work:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;;&gt;iii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var2</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Despite the fact that there are no ";"s. However, strings will ONLY use the specified delimiters, so:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;-&gt;s[32]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Will NOT work - the variable "str" will contain "hello 1". On the other hand, the example from earlier, slightly modified:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;there&gt;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;&gt;&gt;s[32]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
WILL work and will give an output of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello there<br />
27</code></div></div><br />
You can now have optional delimiters using "P" (upper case "p" to match other "optional" specifiers). These are optional in the sense that you specify multiple delimiters and any one of them can be used to end the next symbol:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"(4,&nbsp;5,&nbsp;6,&nbsp;7)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"P&lt;(),&gt;{s[2]}iiii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">d</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
This uses a "quiet section" to ignore anything before the first "(", and then uses multiple delimiters to end all the text. Example:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"42,&nbsp;43;&nbsp;44@"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"P&lt;,;@&gt;a&lt;i&gt;[3]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Optional specifiers</span></span></span></span><br />
</li>
</ul>
<br />
EVERY format specifier (that is, everything except '', {} and p) now has an optional equivalent - this is just their letter capitalised, so for example the old "z" optional string specifier is now "S" (there is still "z" and, for completeness, "Z", but both give warnings). In addition to optional specifiers, there are also now default values:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"I(12)"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
The "()"s (round brackets) contain the default value for the optional integer and, as the main string has no data, the value of "var" becomes "12". Default values come before array sizes and after specifications, so an optional array would look like:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"A&lt;i&gt;(3)[4]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Note that the size of the array is "4" and the default value is "3". There are also two values which are defined, so the final value of "arr" is:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>1, 2, 3, 3</code></div></div><br />
Array default values are clever, the final value of:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"A&lt;i&gt;(3,6)[4]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will be:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>3, 6, 9, 12</code></div></div><br />
The difference between "3" and "6" is "3", so the values increase by that every index. Note that it is not very clever, so:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"A&lt;i&gt;(1,2,2)[4]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will produce:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>1, 2, 2, 2</code></div></div><br />
The difference between "2" and "2" (the last 2 numbers in the default) is 0, so there will be no further increase. For "l" (logical) arrays, the value is always the same as the last value, as it is with "g" if the last value is one of the special values (INFINITY, NEG_INFINITY (same as -INFINITY), NAN or NAN_E). Note that:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"a&lt;I&gt;(1,2,2)[4]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Is invalid syntax, the "A" must be the capital part.<br />
<br />
Enums can also be optional:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"4"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"E&lt;ifs[32]c&gt;(1,&nbsp;12.0,&nbsp;Bob,&nbsp;c)"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
In that code all values except "4" will be default. Also, again, you can escape commas with "\\" in default enum strings. Some final examples:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"I(2)I(3)I(4)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"O(045)H(0xF4)B(0b0100)U(Y_Less)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">octnum</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">hexnum</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">binnum</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">user</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"0xFF"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"N(0b101)"</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
That last example is of a specifier not too well described yet - the "number" specifier, which will work out the format of the number from the leading characters (0x, 0b, 0 or nothing). Also note that the second example has changed - see the next section.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Users</span></span></span></span><br />
</li>
</ul>
<br />
The "u", "q", and "r" specifiers search for a user by name or ID. The method of this search has changed in the latest versions of "sscanf".<br />
<br />
Additionally "U", "Q", and "R" used to take a name or ID as their default value - this has since been changed to JUST a number, and sscanf will not try and determine if this number is online:<br />
<br />
Previous:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"U(Y_Less)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">INVALID_PLAYER_ID</span><span style="color: #007700">)<br />{<br />?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Y_Less&nbsp;or&nbsp;the&nbsp;entered&nbsp;player&nbsp;is&nbsp;not&nbsp;connected.<br /></span><span style="color: #007700">}&nbsp;<br /></span></code></div></div></div><br />
New:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"U(-1)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">)<br />{<br />?&nbsp;?</span><span style="color: #FF8000">//&nbsp;No&nbsp;player&nbsp;was&nbsp;entered.<br /></span><span style="color: #007700">}<br />else&nbsp;if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">INVALID_PLAYER_ID</span><span style="color: #007700">)<br />?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Entered&nbsp;player&nbsp;is&nbsp;not&nbsp;connected.<br /></span><span style="color: #007700">}&nbsp;<br /></span></code></div></div></div><br />
See the section on options for more details.<br />
<br />
Users can now optionally return an ARRAY of users instead of just one. This array is just a list of matched IDs, followed by "INVALID_PLAYER_ID". Given the following players:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>0) Y_Less<br />
1) [CLAN]Y_Less<br />
2) Jake<br />
3) Alex<br />
4) Hass</code></div></div><br />
This code:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">ids</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">;<br />if&nbsp;(</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Le"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;MATCH_NAME_PARTIAL=1&gt;u[3]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">ids</span><span style="color: #007700">))&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Error&nbsp;in&nbsp;input"</span><span style="color: #007700">);<br />for&nbsp;(</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">ids</span><span style="color: #007700">[</span><span style="color: #0000BB">i</span><span style="color: #007700">]&nbsp;!=&nbsp;</span><span style="color: #0000BB">INVALID_PLAYER_ID</span><span style="color: #007700">;&nbsp;)<br />{<br />?&nbsp;?if&nbsp;(</span><span style="color: #0000BB">ids</span><span style="color: #007700">[</span><span style="color: #0000BB">i</span><span style="color: #007700">]&nbsp;==&nbsp;</span><span style="color: #0000BB">cellmin</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Too&nbsp;many&nbsp;matches"</span><span style="color: #007700">);<br />?&nbsp;?&nbsp;?&nbsp;?break;<br />?&nbsp;?}<br />?&nbsp;?</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"id&nbsp;=&nbsp;%d"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">ids</span><span style="color: #007700">[</span><span style="color: #0000BB">i</span><span style="color: #007700">]);<br />}<br />if&nbsp;(</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"No&nbsp;matching&nbsp;players&nbsp;found."</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will output:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>id = 0<br />
id = 1<br />
Too many matches</code></div></div><br />
Searching "Les" instead will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>id = 0<br />
id = 1</code></div></div><br />
And searching without "MATCH_NAME_PARTIAL" will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>No matching players found.</code></div></div><br />
Basically, if an array of size "N" is passed, this code will return the first N-1 results. If there are less than "N" players whose name matches the given name then that many players will be returned and the next slot will be "INVALID_PLAYER_ID" to indicate the end of the list. On the other hand if there are MORE than "N - 1" players whose name matches the given pattern, then the last slot will be "cellmin" to indicate this fact.<br />
<br />
When combined with "U" and returning the default, the first slot is always exactly the default value (even if that's not a valid connected player) and the next slot is always "INVALID_PLAYER_ID".<br />
<br />
Note also that user arrays can't be combined with normal arrays or enums, but normal single-return user specifiers still can be.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Custom (kustom) specifiers</span></span></span></span><br />
</li>
</ul>
<br />
The latest version of sscanf adds a new "k" specifier to allow you to define your own specifers in PAWN:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">SSCANF</span><span style="color: #007700">:</span><span style="color: #0000BB">playerstate</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">[])<br />{<br />?&nbsp;?if&nbsp;(</span><span style="color: #DD0000">'0'&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]&nbsp;&lt;=&nbsp;</span><span style="color: #DD0000">'9'</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?new<br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #0000BB">ret&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strval</span><span style="color: #007700">(string);<br />?&nbsp;?&nbsp;?&nbsp;?if&nbsp;(</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">ret&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">9</span><span style="color: #007700">)<br />?&nbsp;?&nbsp;?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?return&nbsp;</span><span style="color: #0000BB">ret</span><span style="color: #007700">;<br />?&nbsp;?&nbsp;?&nbsp;?}<br />?&nbsp;?}<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_NONE"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_ONFOOT"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_DRIVER"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_PASSENGER"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_WASTED"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">7</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_SPAWNED"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_SPECTATING"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">9</span><span style="color: #007700">;<br />}&nbsp;<br /></span></code></div></div></div><br />
The code above, when added to the top level of your mode, will add the "playerstate" specifier, allowing you to do:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"uk&lt;playerstate&gt;"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">state</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
This system supports optional custom specifiers with no additional PAWN code:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"uK&lt;playerstate&gt;(PLAYER_STATE_NONE)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">state</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
The new version of "sscanf2.inc" includes functions for "k&lt;weapon&gt;" and "k&lt;vehicle&gt;" allowing you to enter either the ID or name and get the ID back, but both are VERY basic at the moment and I expect other people will improve on them.<br />
<br />
Note that custom specifiers are not supported in either arrays or enumerations.<br />
<br />
Note also that custom specifiers always take a string input and always return a number, but this can be a Float, bool, or any other single cell tag type.<br />
<br />
The optional kustom specifier "K" takes a default value that is NOT (as of sscanf 2.8) parsed by the given callback:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>K&lt;vehicle&gt;(999)</code></div></div><br />
"999" is NOT a valid vehicle model, but if no other value is supplied then 999 will be returned, allowing you to differentiate between the user entering an invalid vehicle and not entering anything at all.<br />
<br />
Also as of sscanf 2.8, "k" can be used in both arrays and enums.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Options</span></span></span></span></span><br />
<br />
The latest version of sscanf introduces several options that can be used to customise the way in which sscanf operates. There are two ways of setting these options - globally and locally:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">SSCANF_Option</span><span style="color: #007700">(</span><span style="color: #0000BB">SSCANF_QUIET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
This sets the "SSCANF_QUIET" option globally. Every time "sscanf" is called the option (see below) will be in effect. Note that the use of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SSCANF_QUIET</code></div></div><br />
Instead of a string as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SSCANF_QUIET</code></div></div><br />
Is entirely valid here - all the options are defined in the sscanf2 include already.<br />
<br />
Alternatively you can use "?" to specify an option locally - i.e. only for the current sscanf call:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;SSCANF_QUIET=1&gt;si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Obviously "s" without a length is deprecated, and the first and last "sscanf" calls will give a warning in the console, but the second one won't as for just that one call prints have been disabled. The following code disables prints globally then enables them locally:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">SSCANF_Option</span><span style="color: #007700">(</span><span style="color: #0000BB">SSCANF_QUIET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;SSCANF_QUIET=0&gt;si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Note that disabling prints is a VERY bad idea when developing code as you open yourself up to unreported buffer overflows when no length is specified on strings less than 32 cells (the default length).<br />
<br />
To specify multiple options requires multiple calls:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">SSCANF_Option</span><span style="color: #007700">(</span><span style="color: #0000BB">SSCANF_QUIET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">SSCANF_Option</span><span style="color: #007700">(</span><span style="color: #0000BB">MATCH_NAME_PARTIAL</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;SSCANF_QUIET=1&gt;?&lt;MATCH_NAME_PARTIAL=0&gt;s[10]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
The options are:<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">OLD_DEFAULT_NAME:</span></span></span></span><br />
</li>
</ul>
<br />
? ?The behaviour of "U", "Q", and "R" have been changed to take any number as a default, instead of a connected player. Setting "OLD_DEFAULT_NAME" to "1" will revert to the old version.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">MATCH_NAME_PARTIAL:</span></span></span></span><br />
</li>
</ul>
<br />
? ?Currently sscanf will search for players by name, and will ALWAYS search for player whose name STARTS with the specified string. If you have, say "[CLAN]Y_Less" connected and someone types "Y_Less", sscanf will not find "[CLAN]Y_Less" because there name doesn't start with the specified name. This option, when set to 1, will search ANYWHERE in the player's name for the given string.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">CELLMIN_ON_MATCHES:</span></span></span></span><br />
</li>
</ul>
<br />
? ?Whatever the value of "MATCH_NAME_PARTIAL", the first found player will always be returned, so if you do a search for "_" on an RP server, you could get almost anyone. To detect this case, if more than one player will match the specified string then sscanf will return an ID of "cellmin" instead. This can be combined with "U" for a lot more power:<br />
<br />
? ?<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">?&nbsp;?</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;CELLMIN_ON_MATCHES=1&gt;U(-1)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">);<br />?&nbsp;?if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #FF8000">//&nbsp;No&nbsp;player&nbsp;was&nbsp;entered.<br /></span><span style="color: #007700">?&nbsp;?}<br />?&nbsp;?else&nbsp;if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">cellmin</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Multiple&nbsp;matches&nbsp;found<br /></span><span style="color: #007700">?&nbsp;?}<br />?&nbsp;?else&nbsp;if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">INVALID_PLAYER_ID</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Entered&nbsp;player&nbsp;is&nbsp;not&nbsp;connected.<br /></span><span style="color: #007700">?&nbsp;?}<br />?&nbsp;?else<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Found&nbsp;just&nbsp;one&nbsp;player.<br /></span><span style="color: #007700">?&nbsp;?}<br />?&nbsp;?&nbsp;<br /></span></code></div></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">SSCANF_QUIET:</span></span></span></span><br />
</li>
</ul>
<br />
? ?Don't print any errors to the console. REALLY not recommended unless you KNOW your code is stable and in production.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">OLD_DEFAULT_KUSTOM:</span></span></span></span><br />
</li>
</ul>
<br />
? ?As with "U", "K" used to require a valid identifier as the default and would parse it using the specified callback, so this would NOT work:<br />
<br />
? ?<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>? ?K&lt;vehicle&gt;(Veyron)<br />
? ?</code></div></div><br />
? ?Because that is not a valid vehicle name in GTA. The new version now JUST takes a number and returns that regardless:<br />
<br />
? ?[code<br />
? ?K&lt;vehicle&gt;(9999)<br />
? ?[/code]<br />
<br />
? ?This setting reverts to the old behaviour.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">All specifiers</span></span></span></span></span><br />
<br />
For quick reference, here is a list of ALL the specifiers and their use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[b][u]Format[/u][/b] [b][u]Use[/u][/b]<br />
L(true/false) Optional logical truthity<br />
l Logical truthity<br />
K&lt;callback&gt;(any format number) ? ? ? ?Optional custom operator<br />
k&lt;callback&gt; Custom operator<br />
B(binary) Optional binary number<br />
b Binary number<br />
N(any format number) Optional number<br />
n Number<br />
C(character) Optional character<br />
c Character<br />
I(integer) Optional integer<br />
i Integer<br />
D(integer) Optional integer<br />
d Integer<br />
H(hex value) Optional hex number<br />
h Hex number<br />
O(octal value) Optional octal value<br />
o Octal value<br />
F(float) Optional floating point number<br />
f Floating point number<br />
G(float/INFINITY/-INFINITY/NAN/NAN_E) Optional float with IEEE definitions<br />
g Float with IEEE definitions<br />
{ Open quiet section<br />
} Close quiet section<br />
P&lt;delimiters&gt; Multiple delimiters change<br />
p&lt;delimiter&gt; Delimiter change<br />
Z(string)[length] Invalid optional string<br />
z(string)[length] Deprecated optional string<br />
S(string)[length] Optional string<br />
s[length] String<br />
U(any format number) Optional user (bot/player)<br />
u User (bot/player)<br />
Q(any format number) Optional bot (bot)<br />
q Bot (bot)<br />
R(any format number) Optional player (player)<br />
r Player (player)<br />
A&lt;type&gt;(default)[length] Optional array of given type<br />
a&lt;type&gt;[length] Array of given type<br />
E&lt;specification&gt;(default) Optional enumeration of given layout<br />
e&lt;specification&gt; Enumeration of given layout<br />
'string' Search string<br />
% Deprecated optional specifier prefix<br />
? Local options specifier</code></div></div><br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">"extract"</span></span></span></span></span><br />
<br />
I've written some (extendable) macros so you can do:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;&nbsp;else<br />{<br />?&nbsp;?return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">COLOUR_RED</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"FAIL!"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
This will compile as:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;<br />if&nbsp;(</span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"is[32]f"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">))<br />{<br />?&nbsp;?return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">COLOUR_RED</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"FAIL!"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
Note that "unformat" is the same as "sscanf", also note that the "SendClientMessage" part is optional:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;&nbsp;<br /></span></code></div></div></div><br />
Will simply compile as:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"is[32]f"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Basically it just simplifies sscanf a little bit (IMHO). I like new operators and syntax, hence this, examples:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">//&nbsp;An&nbsp;int&nbsp;and&nbsp;a&nbsp;float.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;An&nbsp;int&nbsp;and&nbsp;an&nbsp;OPTIONAL&nbsp;float.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">b&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">7.0</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;An&nbsp;int&nbsp;and&nbsp;a&nbsp;string.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">s</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">];<br /></span><span style="color: #FF8000">//&nbsp;An&nbsp;int&nbsp;and&nbsp;a&nbsp;playerid.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">;&nbsp;<br /></span></code></div></div></div><br />
As I say, the syntax is extendable, so to add hex numbers you would do:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">#define&nbsp;hex_EXTRO:%0##%1,%2|||%3=%9|||%4,%5)&nbsp;EXTRY:%0##%1H"("#%9")"#,%2,%3|||%4|||%5)<br />#define&nbsp;hex_EXTRN:%0##%1,%2|||%3|||%4,%5)&nbsp;EXTRY:%0##%1h,%2,%3|||%4|||%5)<br />#define&nbsp;hex_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5)&nbsp;EXTRY:%0##%1a&lt;h&gt;[%7],%2,%3|||%4|||%5)&nbsp;<br /></span></code></div></div></div><br />
That will add the tag "hex" to the system. Yes, the lines look complicated (because they are), but the ONLY things you need to change are the name before the underscore and the letter near the middle ("H", "h" and "a&lt;h&gt;" in the examples above for "optional", "required" and "required array" (no optional arrays yet besides strings)).<br />
<br />
New examples (with "hex" added):<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">//&nbsp;A&nbsp;hex&nbsp;number&nbsp;and&nbsp;a&nbsp;player.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;hex</span><span style="color: #007700">:</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;32&nbsp;numbers&nbsp;then&nbsp;32&nbsp;players.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">];<br /></span><span style="color: #FF8000">//&nbsp;11&nbsp;floats,&nbsp;an&nbsp;optional&nbsp;string,&nbsp;then&nbsp;an&nbsp;optional&nbsp;hex&nbsp;number.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;Float</span><span style="color: #007700">:</span><span style="color: #0000BB">f</span><span style="color: #007700">[</span><span style="color: #0000BB">11</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">s</span><span style="color: #007700">[</span><span style="color: #0000BB">12</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #DD0000">"optional"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">hex</span><span style="color: #007700">:</span><span style="color: #0000BB">end&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">;&nbsp;<br /></span></code></div></div></div><br />
The code is actually surprisingly simple (I developed another new technique to simplify my "tag" macros and it paid off big style here). By default "Float", "string", "player" and "_" (i.e. no tag) are supported, and their individual letter definitions take up the majority of the code as demonstrated with the "hex" addition above. Note that "string:" is now used extensively in my code to differentiate from tagless arrays in cases like this, it is removed automatically but "player:" and "hex:" are not so you may wish to add:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">#define&nbsp;player:<br />#define&nbsp;hex:&nbsp;<br /></span></code></div></div></div><br />
To avoid tag mismatch warnings (to remove them AFTER the compiler has used them to determine the correct specifier).<br />
<br />
The very first example had an "else", this will turn:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
In to:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">))&nbsp;<br /></span></code></div></div></div><br />
You MUST put the "else" on the same line as "extract" for it to be detected, but then you can use normal single or multi-line statements. This is to cover common command use cases, you can even leave things on the same line:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">else&nbsp;return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF0000AA</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Usage:&nbsp;/cmd&nbsp;&lt;whatever&gt;"</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
There is now the ability to split by things other than space (i.e. adds "P&lt;?&gt;" to the syntax - updated from using "p" to "P"):<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">extract&nbsp;params</span><span style="color: #007700">&lt;|&gt;&nbsp;-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;&nbsp;<br /></span></code></div></div></div><br />
Will simply compile as:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"P&lt;|&gt;is[32]f"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Note that for technical reasons you can use "&lt;-&gt;" (because it looks like the arrow after the "extract" keyword). You also can't use "&lt;;&gt;", "&lt;,&gt;", or "&lt;)&gt;" because of a bug with "#", but you can use any other character (most notably "&lt;|&gt;", as is popular with SQL scripts). I'm thinking of adding enums and existing variables (currently you HAVE to declare new variables), but not right now.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Errors/Warnings</span></span></span></span></span><br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">MSVRC100.dll not found</span></span></span></span><br />
</li>
</ul>
<br />
If you get this error, DO NOT just download the dll from a random website. This is part of the "Microsoft Visual Studio Redistributable Package". This is required for many programs, but they often come with it. Download it here:<br />
<br />
<a href="http://www.microsoft.com/download/en...s.aspx?id=5555" target="_blank" rel="noopener" class="mycode_url">http://www.microsoft.com/download/en...s.aspx?id=5555</a><br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: System not initialised</span></span></span></span><br />
</li>
</ul>
<br />
If you get this error, you need to make sure that you have recompiled ALL your scripts using the LATEST version of "sscanf2.inc". Older versions didn't really require this as they only had two natives - "sscanf" and "unformat", the new version has some other functions - you don't need to worry about them, but you must use "sscanf2.inc" so that they are correctly called. If you think you have done this and STILL get the error then try again - make sure you are using the correct version of PAWNO for example.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: String buffer overflow.</span></span></span></span><br />
</li>
</ul>
<br />
This error comes up when people try and put too much data in to a string. For example:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">[</span><span style="color: #0000BB">10</span><span style="color: #007700">];<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Hello&nbsp;there,&nbsp;how&nbsp;are&nbsp;you?"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s[10]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
That code will try and put the string "Hello there, how are you?" in to the variable called "str". However, "str" is only 10 cells big and can thus only hold the string "Hello ther" (with a NULL terminator). In this case, the rest of the data is ignored - which could be good or bad:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">[</span><span style="color: #0000BB">10</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Hello&nbsp;there&nbsp;you|42"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;|&gt;s[10]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
In this case "num" is still correctly set to "42", but the warning is given for lost data ("e you").<br />
<br />
Currently there is nothing you can do about this from a programming side (you can't even detect it - that is a problem I intend to address), as long as you specify how much data a user should enter this will simply discard the excess, or make the destination variable large enough to handle all cases.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Optional types invalid in array specifiers, consider using 'A'.</span></span></span></span><br />
</li>
</ul>
<br />
A specifier such as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;I(5)&gt;[10]</code></div></div><br />
Has been written - here indicating an array of optional integers all with the default value "5". Instead you should use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;i&gt;(5)[10]</code></div></div><br />
This is an optional array of integers all with the default value "5", the advantage of this is that arrays can have multiple defaults:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;i&gt;(5, 6)[10]</code></div></div><br />
That will set the array to "5, 6, 7, 8, 9, 10, 11, 12, 13, 14" by default, incrementing by the found difference each time.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Optional types invalid in enum specifiers, consider using 'E'.</span></span></span></span><br />
</li>
</ul>
<br />
Similar to the previous warning, A specifier such as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;I(5)f&gt;</code></div></div><br />
Is invalid, instead use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;if&gt;(42, 11.0)</code></div></div><br />
This forces ALL the parts of an enum to be optional - anything less is not possible.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Multi-dimensional arrays are not supported.</span></span></span></span><br />
</li>
</ul>
<br />
This is not allowed:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"a&lt;a&lt;i&gt;[5]&gt;[10]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
A work-around can be done using:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"a&lt;i&gt;[50]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]);&nbsp;<br /></span></code></div></div></div><br />
That will correctly set up the pointers for the system.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Search strings are not supported in arrays.</span></span></span></span><br />
</li>
</ul>
<br />
This is not allowed (see the section on search strings):<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;'hello'i&gt;[10]</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Delimiters are not supported in arrays.</span></span></span></span><br />
</li>
</ul>
<br />
This is not allowed:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;p&lt;,&gt;i&gt;[10]</code></div></div><br />
Instead use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;,&gt;a&lt;i&gt;[10]</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Quiet sections are not supported in arrays.</span></span></span></span><br />
</li>
</ul>
<br />
<br />
This is not allowed:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;{i}&gt;[10]</code></div></div><br />
Instead use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>{a&lt;i&gt;[10]}</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Unknown format specifier '?'.</span></span></span></span><br />
</li>
</ul>
<br />
The given specifier is not known (this post contains a full list of all the specifiers near the bottom).<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: 'Z' doesn't exist - that would be an optional, deprecated optional string!.</span></span></span></span><br />
</li>
</ul>
<br />
You used "Z", don't; instead use "S".<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: 'z' is deprecated, consider using 'S' instead.</span></span></span></span><br />
</li>
</ul>
<br />
<br />
You used "z", don't; instead use "S".<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Empty default values.</span></span></span></span><br />
</li>
</ul>
<br />
An optional specifier has been set as (for example):<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I()</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I(42)</code></div></div><br />
This does not apply to strings as they can be legitimately empty.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Unclosed default value.</span></span></span></span><br />
</li>
</ul>
<br />
You have a default value on an optional specifier that looks like:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I(42</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I(42)</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: No default value found.</span></span></span></span><br />
</li>
</ul>
<br />
You have no default value on an optional specifier:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I(42)</code></div></div><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Unclosed specifier parameter, assuming '&lt;', consider using something like p&lt;&lt;&gt;.</span></span></span></span><br />
</li>
</ul>
<br />
A custom delimiter of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;</code></div></div><br />
Was found with no matching "&gt;" after one character. In this case the system assumes you are using the old (deprecated) style of delimiters and sets it to just "&lt;". Instead use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;,&gt;</code></div></div><br />
Or, if you really do want a delimiter of "&lt;" then use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;&lt;&gt;</code></div></div><br />
Note that this does not need to be escaped; however, a delimiter of "&gt;" does:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;&#92;&gt;&gt;</code></div></div><br />
The "\" may also need to be escaped when writing actual PAWN strings, leading to:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;&#92;&#92;&gt;&gt;</code></div></div><br />
This also applies to array types ("a&lt;" vs "a&lt;i&gt;"), note that this will result in an invalid array type.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Unenclosed specifier parameters are deprecated, consider using something like p&lt;&lt;&gt;.</span></span></span></span><br />
</li>
</ul>
<br />
You are using the old style:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p,</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;,&gt;</code></div></div><br />
This also applies to array types ("ai" vs "a&lt;i&gt;").<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: No specified parameter found.</span></span></span></span><br />
</li>
</ul>
<br />
The format specifier just ends with:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p</code></div></div><br />
This also applies to array types ("a" vs "a&lt;i&gt;").<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Missing string length end.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Missing length end.</span></span></span></span><br />
</li>
</ul>
<br />
A string has been written as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>s[10</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>s[10]</code></div></div><br />
I.e. the length has not been closed.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Arrays without a length are deprecated, please add a destination size.</span></span></span></span><br />
</li>
</ul>
<br />
A string has been written as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>s</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>s[10]</code></div></div><br />
I.e. the length has not been included.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Invalid data length.</span></span></span></span><br />
</li>
</ul>
<br />
An invalid array or string size has been specified (0, negative, or not a number).<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Invalid character in data length.</span></span></span></span><br />
</li>
</ul>
<br />
A string or array has been given a length that is not a number.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Strings without a length are deprecated, please add a destination size.</span></span></span></span><br />
</li>
</ul>
<br />
In the old system, strings were not required to have lengths but this introduced security problems with overflows. Now you must add a length or get the default of "32".<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: String/array must include a length, please add a destination size.</span></span></span></span><br />
</li>
</ul>
<br />
Arrays are newer than strings, so never had an implementation not requiring a length, so there is no compatability problems in REQUIRING a length to be given.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Can't have nestled quiet sections.</span></span></span></span><br />
</li>
</ul>
<br />
You have tried writing something like this:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>{i{x}}</code></div></div><br />
This has a quiet section ("{}") inside another one, which makes no sense.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Not in a quiet section.</span></span></span></span><br />
</li>
</ul>
<br />
"}" was found with no corresponding "{":<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>i}</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Can't remove quiet in enum.</span></span></span></span><br />
</li>
</ul>
<br />
This is caused by specifiers such as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>{fe&lt;i}x&gt;</code></div></div><br />
Where the quiet section is started before the enum, but finishes part way through it rather than after it. This can be emulated by:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>{f}e&lt;{i}x&gt;</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Arrays are not supported in enums.</span></span></span></span><br />
</li>
</ul>
<br />
<br />
Basically, you can't do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;fa&lt;i&gt;[5]f&gt;</code></div></div><br />
You can, however, still do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;fiiiiif&gt;</code></div></div><br />
This is a little more awkward, but is actually more technically correct given how enums are compiled.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Unclosed string literal.</span></span></span></span><br />
</li>
</ul>
<br />
A specifier starts a string with "'", but doesn't close it:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>i'hello</code></div></div><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: sscanf specifiers do not require '%' before them.</span></span></span></span><br />
</li>
</ul>
<br />
"format" uses code such as "%d", sscanf only needs "d", and confusingly the C equivalent function (also called "sscanf") DOES require "%". Sorry.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Insufficient default values.</span></span></span></span><br />
</li>
</ul>
<br />
Default values for arrays can be partially specified and the remainder will be inferred from the pattern of the last two:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;i&gt;(0, 1)[10]</code></div></div><br />
That specifier will default to the numbers "0" to "9". However, because enums have a mixture of types, all the default values for "E" must ALWAYS be specified:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;iiff&gt;(0, 1, 0.0, 1.0)</code></div></div><br />
This will not do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;iiff&gt;(0, 1)</code></div></div><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Options are not supported in enums.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Options are not supported in arrays.</span></span></span></span><br />
</li>
</ul>
<br />
The "?" specifier for local options must appear outside any other specifier.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: No option value.</span></span></span></span><br />
</li>
</ul>
<br />
An option was specified with no value:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>?&lt;OLD_DEFAULT_NAME&gt;</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Unknown option name.</span></span></span></span><br />
</li>
</ul>
<br />
The given option was not recognised. Check spelling and case:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>?&lt;NOT_A_VALID_NAME=1&gt;</code></div></div><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Could not find function SSCANF:?.</span></span></span></span><br />
</li>
</ul>
<br />
A "k" specifier has been used, but the corresponding function could not be found. If you think it is there check the spelling matches exactly - including the case.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: SSCANF_Init has incorrect parameters.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: SSCANF_Join has incorrect parameters.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: SSCANF_Leave has incorrect parameters.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: SSCANF_SetPlayerName has incorrect parameters.</span></span></span></span><br />
</li>
</ul>
<br />
You edited something in the sscanf2 include - undo it or redownload it.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Changelog</span></span></span></span></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf 2.8.2 - 18/04/2015</span></span></span></span><br />
- Fixed a bug where "u" wasn't working correctly after a server restart.]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf 2.8.2</span></span></span></span></span></div>
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">NPC modes</span></span></span></span></span><br />
<br />
To use sscanf in an NPC mode, download this file:<br />
<br />
<a href="http://dl.dropbox.com/u/21683085/npcdll.rar" target="_blank" rel="noopener" class="mycode_url">http://dl.dropbox.com/u/21683085/npcdll.rar</a><br />
<br />
And extract it to your root server directory (so "amxsscanf.dll" is in the same directory as "samp-npc.exe"). Then use as normal. The only tiny difference is that "u", "r", and "q" don't know if a user is a bot or not, so just assume they are all players - use accordingly.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Downloads</span></span></span></span></span><br />
<br />
GitHub repo (for sscanf 3):<br />
<br />
<a href="https://github.com/maddinat0r/sscanf/releases" target="_blank" rel="noopener" class="mycode_url">https://github.com/maddinat0r/sscanf/releases</a><br />
<br />
Source, Windows .dll, Linux .so and include:<br />
<br />
<a href="https://dl.dropboxusercontent.com/u/102595204/sscanf-2.8.2.zip" target="_blank" rel="noopener" class="mycode_url">https://dl.dropboxusercontent.com/u/1025...-2.8.2.zip</a><br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Use</span></span></span></span></span><br />
<br />
This behaves exactly as the old sscanf did, just MUCH faster and much more flexibly. To use it add:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">#include&nbsp;&lt;sscanf2&gt;&nbsp;<br /></span></code></div></div></div><br />
To your modes and remove the old sscanf (the new include will detect the old version and throw an error if it is detected). On windows add:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">plugins&nbsp;sscanf&nbsp;<br /></span></code></div></div></div><br />
To server.cfg. On Linux add:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">plugins&nbsp;sscanf</span><span style="color: #007700">.</span><span style="color: #0000BB">so&nbsp;<br /></span></code></div></div></div><br />
The basic code looks like:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ui"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">giveplayerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">amount</span><span style="color: #007700">))<br />{<br />?&nbsp;?return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF0000AA</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Usage:&nbsp;/givecash&nbsp;&lt;playerid/name&gt;&nbsp;&lt;amount&gt;"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
However it should be noted that sscanf can be used for any text processing you like. For example an ini processor could look like (don't worry about what the bits mean at this stage):<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">szFileLine</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;=&gt;s[8]s[32]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">szIniName</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">szIniValue</span><span style="color: #007700">))<br />{<br />?&nbsp;?</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Invalid&nbsp;INI&nbsp;format&nbsp;line"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
There is also an alternate function name to avoid confusion with the C standard sscanf:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ui"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">giveplayerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">amount</span><span style="color: #007700">))<br />{<br />?&nbsp;?return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF0000AA</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Usage:&nbsp;/givecash&nbsp;&lt;playerid/name&gt;&nbsp;&lt;amount&gt;"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Specifiers</span></span></span></span></span><br />
<br />
The available specifiers (the letters "u", "i" and "s" in the codes above) are below.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Basic specifiers</span></span></span></span><br />
</li>
</ul>
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Specifier(s) ? ? ? ? ? ? ? Name ? ? ? ? ? ? ? ? ? Example values<br />
? ?i, d ? ? ? ? Integer ? ? ? ? ? ? ? ? ? ? ? ? ? ?1, 42, -10<br />
? ?c ? ? ? ? ? ?Character ? ? ? ? ? ? ? ? ? ? ? ? ?a, o, *<br />
? ?l ? ? ? ? ? ?Logical ? ? ? ? ? ? ? ? ? ? ? ? ? ?true, false<br />
? ?b ? ? ? ? ? ?Binary ? ? ? ? ? ? ? ? ? ? ? ? ? ? 01001, 0b1100<br />
? ?h, x ? ? ? ? Hex ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1A, 0x23<br />
? ?o ? ? ? ? ? ?Octal ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?045 12<br />
? ?n ? ? ? ? ? ?Number ? ? ? ? ? ? ? ? ? ? ? ? ? ? 42, 0b010, 0xAC, 045<br />
? ?f ? ? ? ? ? ?Float ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.7, -99.5<br />
? ?g ? ? ? ? ? ?IEEE Float ? ? ? ? ? ? ? ? ? ? ? ? 0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E<br />
? ?u ? ? ? ? ? ?User name/id (bots and players) ? ?Y_Less, 0<br />
? ?q ? ? ? ? ? ?Bot name/id ? ? ? ? ? ? ? ? ? ? ? ?ShopBot, 27<br />
? ?r ? ? ? ? ? ?Player name/id ? ? ? ? ? ? ? ? ? ? Y_Less, 42</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Strings</span></span></span></span><br />
</li>
</ul>
<br />
<br />
The specifier "s" is used, as before, for strings - but they are now more advanced. As before they support collection, so doing:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">val</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello<br />
27</code></div></div><br />
Doing:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;there&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">val</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will fail as "there" is not a number. However doing:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;there"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello there</code></div></div><br />
Because there is nothing after "s" in the specifier, the string gets everything. To stop this simply add a space:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;there"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s&nbsp;"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello</code></div></div><br />
You can also escape parts of strings with "\\" - note that it is two backslashes as 1 is used by the compiler:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&#092;&#092;&nbsp;there&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">val</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello there<br />
27</code></div></div><br />
All these examples however will give warnings in the server as the new version has array sizes. The above code should be:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new<br />?&nbsp;?</span><span style="color: #0000BB">str</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],<br />?&nbsp;?</span><span style="color: #0000BB">val</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&#092;&#092;&nbsp;there&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s[32]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">val</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
As you can see - the format specifier now contains the length of the target string, ensuring that you can never have your strings overflow and cause problems. This can be combined with the SA:MP compiler's stringizing:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">#define&nbsp;STR_SIZE&nbsp;32<br /></span><span style="color: #007700">new<br />?&nbsp;?</span><span style="color: #0000BB">str</span><span style="color: #007700">[</span><span style="color: #0000BB">STR_SIZE</span><span style="color: #007700">],<br />?&nbsp;?</span><span style="color: #0000BB">val</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&#092;&#092;&nbsp;there&nbsp;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s["&nbsp;</span><span style="color: #FF8000">#STR_SIZE&nbsp;"]i",&nbsp;str,&nbsp;val);&nbsp;<br /></span></code></div></div></div><br />
So when you change your string size you don't need to change your specifiers.<br />
<br />
What happened to "z", the optional string? z has been removed (you can still use it but will get a server warning) to make way for the new optional parameter system described later on.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Arrays</span></span></span></span><br />
</li>
</ul>
<br />
One of the advanced new specifiers is "a", which creates an array, obviously. The syntax is similar to that of strings and, as you will see later, the delimiter code:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new<br />?&nbsp;?</span><span style="color: #0000BB">arr</span><span style="color: #007700">[</span><span style="color: #0000BB">5</span><span style="color: #007700">];<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3&nbsp;4&nbsp;5"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"a&lt;i&gt;[5]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
The "a" specifier is immediately followed by a single type enclosed in angle brackets - this type can be any of the basic types listed above. It is the followed, as with strings now, by an array size. The code above will put the numbers 1 to 5 into the 5 indexes of the "arr" array variable.<br />
<br />
Arrays can now also be combined with strings (see below), specifying the string size in the array type:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;s[10]&gt;[12]</code></div></div><br />
This will produce an array of 12 strings, each up to 10 characters long (9  NULL). Optional string arrays still follow the optional array syntax:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;s[10]&gt;(hello)[12]</code></div></div><br />
However, unlike numbers you can't specify a progression and have it fill up. This code:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;i&gt;(0, 1)[4]</code></div></div><br />
Will by default produce:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>0, 1, 2, 3</code></div></div><br />
However, this code:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;s[10]&gt;(hi, there)[4]</code></div></div><br />
Will by default produce:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>"hi, there", "hi, there", "hi, there", "hi, there"</code></div></div><br />
As normal, you can add brackets in to the default string value with "\)":<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;s[10]&gt;(hi (code&#92;))[4]</code></div></div><br />
It should also be noted that there is NO length checking on default strings. If you do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;s[10]&gt;(This is longer than 10 characters)[4]</code></div></div><br />
You will probably just corrupt the PAWN stack. The length checking is to ensure no users enter malicious data; however, in this case it is up to the scripter to ensure that the data is correct as they are the only one affecting it and shouldn't be trying to crash their own server. Interestingly, arrays of strings actually also work with jagged arrays and arrays that have been shuffled by Slice's quicksort function (this isn't a side-effect, I specifically wrote them to do so).<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Enums</span></span></span></span><br />
</li>
</ul>
<br />
This is possibly the most powerful addition to sscanf ever. This gives you the ability to define the structure of an enum within your specifier string and read any data straight into it. The format takes after that of arrays, but with more types - and you can include strings in enums (but not other enums or arrays):<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">enum<br /></span><span style="color: #007700">?&nbsp;?</span><span style="color: #0000BB">E_DATA<br /></span><span style="color: #007700">{<br />?&nbsp;?</span><span style="color: #0000BB">E_DATA_C</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">E_DATA_X</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_DATA_NAME</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],<br />?&nbsp;?</span><span style="color: #0000BB">E_DATA_Z<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB">main<br /></span><span style="color: #007700">{<br />?&nbsp;?new<br />?&nbsp;?&nbsp;?&nbsp;?var[</span><span style="color: #0000BB">E_DATA</span><span style="color: #007700">];<br />?&nbsp;?</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;12.0&nbsp;Bob&nbsp;c"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"e&lt;ifs[32]c&gt;"</span><span style="color: #007700">,&nbsp;var);<br />}&nbsp;<br /></span></code></div></div></div><br />
Now I'll be impressed if you can read that code straight off, so I'll explain it slowly:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">e&nbsp;</span><span style="color: #007700">-&nbsp;</span><span style="color: #0000BB">Start&nbsp;of&nbsp;the&nbsp;</span><span style="color: #DD0000">"enum"&nbsp;</span><span style="color: #0000BB">type<br /></span><span style="color: #007700">&lt;&nbsp;-&nbsp;</span><span style="color: #0000BB">Starts&nbsp;the&nbsp;specification&nbsp;of&nbsp;the&nbsp;structure&nbsp;of&nbsp;the&nbsp;enum<br />i&nbsp;</span><span style="color: #007700">-&nbsp;</span><span style="color: #0000BB">An&nbsp;integer</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">corresponds&nbsp;with&nbsp;E_DATA_C<br />f&nbsp;</span><span style="color: #007700">-&nbsp;</span><span style="color: #0000BB">A&nbsp;float</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">corresponds&nbsp;with&nbsp;E_DATA_X<br />s</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">]&nbsp;-&nbsp;</span><span style="color: #0000BB">A&nbsp;32&nbsp;cell&nbsp;string</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">corresponds&nbsp;with&nbsp;E_DATA_NAME<br />c&nbsp;</span><span style="color: #007700">-&nbsp;</span><span style="color: #0000BB">A&nbsp;character</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">corresponds&nbsp;with&nbsp;E_DATA_Z<br /></span><span style="color: #007700">&gt;&nbsp;-&nbsp;</span><span style="color: #0000BB">End&nbsp;of&nbsp;the&nbsp;enum&nbsp;specification&nbsp;<br /></span></code></div></div></div><br />
Note that an enum doesn't require a size like arrays and strings - it's size is determined by the number and size of the types. Most, but not all, specifiers can be used inside enums (notably arrays and other enums can't be).<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Quiet</span></span></span></span><br />
</li>
</ul>
<br />
The two new specifiers "{" and "}" are used for what are known as "quiet" strings. These are strings which are read and checked, but not saved. For example:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"42&nbsp;-100"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"{i}i"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Clearly there are two numbers and two "i", but only one return variable. This is because the first "i" is quiet so is not saved, but affects the return value. The code above makes "var" "-100". The code below will fail in an if check:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hi&nbsp;-100"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"{i}i"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Although the first integer is not saved it is still read - and "hi" is not an integer. Quiet zones can be as long as you like, even for the whole string if you only want to check values are right, not save them:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"i{ii}"</span><span style="color: #007700">,&nbsp;var);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"{iii}"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"i{a&lt;i&gt;[2]}"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
You can also embed quiet sections inside enum specifications:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;12.0&nbsp;Bob&nbsp;42&nbsp;INFINITY&nbsp;c"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"e&lt;ifs[32]{ig}c&gt;"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Quiet sections cannot contain other quiet sections, however they can include enums which contain quiet sections.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Searches</span></span></span></span><br />
</li>
</ul>
<br />
Searches were in the last version of sscanf too, but I'm explaining them again anyway. Strings enclosed in single quotes (') are scanned for in the main string and the position moved on. Note that to search for a single quote you escape it as above using "\\":<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"10&nbsp;11&nbsp;woo&nbsp;12"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"i'woo'i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Gives:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>10<br />
12</code></div></div><br />
You could achieve the same effect with:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"10&nbsp;11&nbsp;woo&nbsp;12"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"i{is[1000]}i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
But that wouldn't check that the string was "woo". Also note the use of "1000" for the string size. Quiet strings must still have a length, but as they aren't saved anywhere you can make this number as large as you like to cover any eventuality. Enum specifications can include search strings.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Enums</span></span></span></span><br />
</li>
</ul>
<br />
This is a feature similar to quiet sections, which allows you to skip overwriting certain parts of an enum:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;ii-i-ii&gt;</code></div></div><br />
Here the "-" is a "minus", and tells sscanf that there is an enum element there, but not to do anything, so if you had:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">enum&nbsp;E<br /></span><span style="color: #007700">{<br />?&nbsp;?</span><span style="color: #0000BB">E_A</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_B</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_C</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_D</span><span style="color: #007700">,<br />?&nbsp;?</span><span style="color: #0000BB">E_E<br /></span><span style="color: #007700">}&nbsp;<br /></span></code></div></div></div><br />
And you only wanted to update the first two and the last fields and leave all others untouched you could use that specifier above. This way sscanf knows how to skip over the memory, and how much memory to skip. Note that this doesn't read anything, so you could also combine this with quiet sections:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;ii-i-i{ii}i&gt;</code></div></div><br />
That will read two values and save them, skip over two memory locations, read two values and NOT save them, then read and save a last value. In this way you can have written down all the values for every slot in the enum, but have only used 3 of them. Note that this is the same with "E" - if you do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;ii-i-ii&gt;</code></div></div><br />
You should ONLY specify THREE defaults, not all five:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;ii-i-ii&gt;(11, 22, 55)</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Delimiters</span></span></span></span><br />
</li>
</ul>
<br />
The previous version of sscanf had "p" to change the symbol used to separate tokens. This specifier still exists but it has been formalised to match the array and enum syntax. What was previously:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1,2,3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p,iii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var2</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Is now:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1,2,3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;,&gt;iii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var2</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
The old version will still work, but it will give a warning. Enum specifications can include delimiters, and is the only time "&lt;&gt;"s are contained in other "&lt;&gt;"s:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;12.0&nbsp;Bob,c"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"e&lt;ifp&lt;,&gt;s[32]c&gt;"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Note that the delimiter will remain in effect after the enum is complete. You can even use "&gt;" as a specifier by doing "p&lt;\&gt;&gt;" (or the older "p&gt;").<br />
<br />
When used with strings, the collection behaviour is overruled. Most specifiers are still space delimited, so for example this will work:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2&nbsp;3"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;;&gt;iii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var2</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Despite the fact that there are no ";"s. However, strings will ONLY use the specified delimiters, so:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;-&gt;s[32]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
Will NOT work - the variable "str" will contain "hello 1". On the other hand, the example from earlier, slightly modified:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"hello&nbsp;there&gt;27"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;&gt;&gt;s[32]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
WILL work and will give an output of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hello there<br />
27</code></div></div><br />
You can now have optional delimiters using "P" (upper case "p" to match other "optional" specifiers). These are optional in the sense that you specify multiple delimiters and any one of them can be used to end the next symbol:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"(4,&nbsp;5,&nbsp;6,&nbsp;7)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"P&lt;(),&gt;{s[2]}iiii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">d</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
This uses a "quiet section" to ignore anything before the first "(", and then uses multiple delimiters to end all the text. Example:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"42,&nbsp;43;&nbsp;44@"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"P&lt;,;@&gt;a&lt;i&gt;[3]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Optional specifiers</span></span></span></span><br />
</li>
</ul>
<br />
EVERY format specifier (that is, everything except '', {} and p) now has an optional equivalent - this is just their letter capitalised, so for example the old "z" optional string specifier is now "S" (there is still "z" and, for completeness, "Z", but both give warnings). In addition to optional specifiers, there are also now default values:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"I(12)"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
The "()"s (round brackets) contain the default value for the optional integer and, as the main string has no data, the value of "var" becomes "12". Default values come before array sizes and after specifications, so an optional array would look like:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1&nbsp;2"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"A&lt;i&gt;(3)[4]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Note that the size of the array is "4" and the default value is "3". There are also two values which are defined, so the final value of "arr" is:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>1, 2, 3, 3</code></div></div><br />
Array default values are clever, the final value of:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"A&lt;i&gt;(3,6)[4]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will be:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>3, 6, 9, 12</code></div></div><br />
The difference between "3" and "6" is "3", so the values increase by that every index. Note that it is not very clever, so:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"A&lt;i&gt;(1,2,2)[4]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will produce:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>1, 2, 2, 2</code></div></div><br />
The difference between "2" and "2" (the last 2 numbers in the default) is 0, so there will be no further increase. For "l" (logical) arrays, the value is always the same as the last value, as it is with "g" if the last value is one of the special values (INFINITY, NEG_INFINITY (same as -INFINITY), NAN or NAN_E). Note that:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"a&lt;I&gt;(1,2,2)[4]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Is invalid syntax, the "A" must be the capital part.<br />
<br />
Enums can also be optional:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"4"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"E&lt;ifs[32]c&gt;(1,&nbsp;12.0,&nbsp;Bob,&nbsp;c)"</span><span style="color: #007700">,&nbsp;var);&nbsp;<br /></span></code></div></div></div><br />
In that code all values except "4" will be default. Also, again, you can escape commas with "\\" in default enum strings. Some final examples:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"I(2)I(3)I(4)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"O(045)H(0xF4)B(0b0100)U(Y_Less)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">octnum</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">hexnum</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">binnum</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">user</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"0xFF"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"N(0b101)"</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
That last example is of a specifier not too well described yet - the "number" specifier, which will work out the format of the number from the leading characters (0x, 0b, 0 or nothing). Also note that the second example has changed - see the next section.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Users</span></span></span></span><br />
</li>
</ul>
<br />
The "u", "q", and "r" specifiers search for a user by name or ID. The method of this search has changed in the latest versions of "sscanf".<br />
<br />
Additionally "U", "Q", and "R" used to take a name or ID as their default value - this has since been changed to JUST a number, and sscanf will not try and determine if this number is online:<br />
<br />
Previous:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"U(Y_Less)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">INVALID_PLAYER_ID</span><span style="color: #007700">)<br />{<br />?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Y_Less&nbsp;or&nbsp;the&nbsp;entered&nbsp;player&nbsp;is&nbsp;not&nbsp;connected.<br /></span><span style="color: #007700">}&nbsp;<br /></span></code></div></div></div><br />
New:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"U(-1)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">)<br />{<br />?&nbsp;?</span><span style="color: #FF8000">//&nbsp;No&nbsp;player&nbsp;was&nbsp;entered.<br /></span><span style="color: #007700">}<br />else&nbsp;if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">INVALID_PLAYER_ID</span><span style="color: #007700">)<br />?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Entered&nbsp;player&nbsp;is&nbsp;not&nbsp;connected.<br /></span><span style="color: #007700">}&nbsp;<br /></span></code></div></div></div><br />
See the section on options for more details.<br />
<br />
Users can now optionally return an ARRAY of users instead of just one. This array is just a list of matched IDs, followed by "INVALID_PLAYER_ID". Given the following players:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>0) Y_Less<br />
1) [CLAN]Y_Less<br />
2) Jake<br />
3) Alex<br />
4) Hass</code></div></div><br />
This code:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">ids</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">;<br />if&nbsp;(</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Le"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;MATCH_NAME_PARTIAL=1&gt;u[3]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">ids</span><span style="color: #007700">))&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Error&nbsp;in&nbsp;input"</span><span style="color: #007700">);<br />for&nbsp;(</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">ids</span><span style="color: #007700">[</span><span style="color: #0000BB">i</span><span style="color: #007700">]&nbsp;!=&nbsp;</span><span style="color: #0000BB">INVALID_PLAYER_ID</span><span style="color: #007700">;&nbsp;)<br />{<br />?&nbsp;?if&nbsp;(</span><span style="color: #0000BB">ids</span><span style="color: #007700">[</span><span style="color: #0000BB">i</span><span style="color: #007700">]&nbsp;==&nbsp;</span><span style="color: #0000BB">cellmin</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Too&nbsp;many&nbsp;matches"</span><span style="color: #007700">);<br />?&nbsp;?&nbsp;?&nbsp;?break;<br />?&nbsp;?}<br />?&nbsp;?</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"id&nbsp;=&nbsp;%d"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">ids</span><span style="color: #007700">[</span><span style="color: #0000BB">i</span><span style="color: #007700">]);<br />}<br />if&nbsp;(</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"No&nbsp;matching&nbsp;players&nbsp;found."</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Will output:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>id = 0<br />
id = 1<br />
Too many matches</code></div></div><br />
Searching "Les" instead will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>id = 0<br />
id = 1</code></div></div><br />
And searching without "MATCH_NAME_PARTIAL" will give:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>No matching players found.</code></div></div><br />
Basically, if an array of size "N" is passed, this code will return the first N-1 results. If there are less than "N" players whose name matches the given name then that many players will be returned and the next slot will be "INVALID_PLAYER_ID" to indicate the end of the list. On the other hand if there are MORE than "N - 1" players whose name matches the given pattern, then the last slot will be "cellmin" to indicate this fact.<br />
<br />
When combined with "U" and returning the default, the first slot is always exactly the default value (even if that's not a valid connected player) and the next slot is always "INVALID_PLAYER_ID".<br />
<br />
Note also that user arrays can't be combined with normal arrays or enums, but normal single-return user specifiers still can be.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Custom (kustom) specifiers</span></span></span></span><br />
</li>
</ul>
<br />
The latest version of sscanf adds a new "k" specifier to allow you to define your own specifers in PAWN:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">SSCANF</span><span style="color: #007700">:</span><span style="color: #0000BB">playerstate</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">[])<br />{<br />?&nbsp;?if&nbsp;(</span><span style="color: #DD0000">'0'&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]&nbsp;&lt;=&nbsp;</span><span style="color: #DD0000">'9'</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?new<br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #0000BB">ret&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strval</span><span style="color: #007700">(string);<br />?&nbsp;?&nbsp;?&nbsp;?if&nbsp;(</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">ret&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">9</span><span style="color: #007700">)<br />?&nbsp;?&nbsp;?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?&nbsp;?&nbsp;?return&nbsp;</span><span style="color: #0000BB">ret</span><span style="color: #007700">;<br />?&nbsp;?&nbsp;?&nbsp;?}<br />?&nbsp;?}<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_NONE"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_ONFOOT"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_DRIVER"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_PASSENGER"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_WASTED"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">7</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_SPAWNED"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">;<br />?&nbsp;?else&nbsp;if&nbsp;(!</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">string</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PLAYER_STATE_SPECTATING"</span><span style="color: #007700">))&nbsp;return&nbsp;</span><span style="color: #0000BB">9</span><span style="color: #007700">;<br />}&nbsp;<br /></span></code></div></div></div><br />
The code above, when added to the top level of your mode, will add the "playerstate" specifier, allowing you to do:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"uk&lt;playerstate&gt;"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">state</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
This system supports optional custom specifiers with no additional PAWN code:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"uK&lt;playerstate&gt;(PLAYER_STATE_NONE)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">state</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
The new version of "sscanf2.inc" includes functions for "k&lt;weapon&gt;" and "k&lt;vehicle&gt;" allowing you to enter either the ID or name and get the ID back, but both are VERY basic at the moment and I expect other people will improve on them.<br />
<br />
Note that custom specifiers are not supported in either arrays or enumerations.<br />
<br />
Note also that custom specifiers always take a string input and always return a number, but this can be a Float, bool, or any other single cell tag type.<br />
<br />
The optional kustom specifier "K" takes a default value that is NOT (as of sscanf 2.8) parsed by the given callback:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>K&lt;vehicle&gt;(999)</code></div></div><br />
"999" is NOT a valid vehicle model, but if no other value is supplied then 999 will be returned, allowing you to differentiate between the user entering an invalid vehicle and not entering anything at all.<br />
<br />
Also as of sscanf 2.8, "k" can be used in both arrays and enums.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Options</span></span></span></span></span><br />
<br />
The latest version of sscanf introduces several options that can be used to customise the way in which sscanf operates. There are two ways of setting these options - globally and locally:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">SSCANF_Option</span><span style="color: #007700">(</span><span style="color: #0000BB">SSCANF_QUIET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
This sets the "SSCANF_QUIET" option globally. Every time "sscanf" is called the option (see below) will be in effect. Note that the use of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SSCANF_QUIET</code></div></div><br />
Instead of a string as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SSCANF_QUIET</code></div></div><br />
Is entirely valid here - all the options are defined in the sscanf2 include already.<br />
<br />
Alternatively you can use "?" to specify an option locally - i.e. only for the current sscanf call:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;SSCANF_QUIET=1&gt;si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Obviously "s" without a length is deprecated, and the first and last "sscanf" calls will give a warning in the console, but the second one won't as for just that one call prints have been disabled. The following code disables prints globally then enables them locally:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">SSCANF_Option</span><span style="color: #007700">(</span><span style="color: #0000BB">SSCANF_QUIET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;SSCANF_QUIET=0&gt;si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"si"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Note that disabling prints is a VERY bad idea when developing code as you open yourself up to unreported buffer overflows when no length is specified on strings less than 32 cells (the default length).<br />
<br />
To specify multiple options requires multiple calls:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">SSCANF_Option</span><span style="color: #007700">(</span><span style="color: #0000BB">SSCANF_QUIET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">SSCANF_Option</span><span style="color: #007700">(</span><span style="color: #0000BB">MATCH_NAME_PARTIAL</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;SSCANF_QUIET=1&gt;?&lt;MATCH_NAME_PARTIAL=0&gt;s[10]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
The options are:<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">OLD_DEFAULT_NAME:</span></span></span></span><br />
</li>
</ul>
<br />
? ?The behaviour of "U", "Q", and "R" have been changed to take any number as a default, instead of a connected player. Setting "OLD_DEFAULT_NAME" to "1" will revert to the old version.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">MATCH_NAME_PARTIAL:</span></span></span></span><br />
</li>
</ul>
<br />
? ?Currently sscanf will search for players by name, and will ALWAYS search for player whose name STARTS with the specified string. If you have, say "[CLAN]Y_Less" connected and someone types "Y_Less", sscanf will not find "[CLAN]Y_Less" because there name doesn't start with the specified name. This option, when set to 1, will search ANYWHERE in the player's name for the given string.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">CELLMIN_ON_MATCHES:</span></span></span></span><br />
</li>
</ul>
<br />
? ?Whatever the value of "MATCH_NAME_PARTIAL", the first found player will always be returned, so if you do a search for "_" on an RP server, you could get almost anyone. To detect this case, if more than one player will match the specified string then sscanf will return an ID of "cellmin" instead. This can be combined with "U" for a lot more power:<br />
<br />
? ?<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">?&nbsp;?</span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"?&lt;CELLMIN_ON_MATCHES=1&gt;U(-1)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">);<br />?&nbsp;?if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #FF8000">//&nbsp;No&nbsp;player&nbsp;was&nbsp;entered.<br /></span><span style="color: #007700">?&nbsp;?}<br />?&nbsp;?else&nbsp;if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">cellmin</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Multiple&nbsp;matches&nbsp;found<br /></span><span style="color: #007700">?&nbsp;?}<br />?&nbsp;?else&nbsp;if&nbsp;(</span><span style="color: #0000BB">id&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">INVALID_PLAYER_ID</span><span style="color: #007700">)<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Entered&nbsp;player&nbsp;is&nbsp;not&nbsp;connected.<br /></span><span style="color: #007700">?&nbsp;?}<br />?&nbsp;?else<br />?&nbsp;?{<br />?&nbsp;?&nbsp;?&nbsp;?</span><span style="color: #FF8000">//&nbsp;Found&nbsp;just&nbsp;one&nbsp;player.<br /></span><span style="color: #007700">?&nbsp;?}<br />?&nbsp;?&nbsp;<br /></span></code></div></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">SSCANF_QUIET:</span></span></span></span><br />
</li>
</ul>
<br />
? ?Don't print any errors to the console. REALLY not recommended unless you KNOW your code is stable and in production.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">OLD_DEFAULT_KUSTOM:</span></span></span></span><br />
</li>
</ul>
<br />
? ?As with "U", "K" used to require a valid identifier as the default and would parse it using the specified callback, so this would NOT work:<br />
<br />
? ?<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>? ?K&lt;vehicle&gt;(Veyron)<br />
? ?</code></div></div><br />
? ?Because that is not a valid vehicle name in GTA. The new version now JUST takes a number and returns that regardless:<br />
<br />
? ?[code<br />
? ?K&lt;vehicle&gt;(9999)<br />
? ?[/code]<br />
<br />
? ?This setting reverts to the old behaviour.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">All specifiers</span></span></span></span></span><br />
<br />
For quick reference, here is a list of ALL the specifiers and their use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>[b][u]Format[/u][/b] [b][u]Use[/u][/b]<br />
L(true/false) Optional logical truthity<br />
l Logical truthity<br />
K&lt;callback&gt;(any format number) ? ? ? ?Optional custom operator<br />
k&lt;callback&gt; Custom operator<br />
B(binary) Optional binary number<br />
b Binary number<br />
N(any format number) Optional number<br />
n Number<br />
C(character) Optional character<br />
c Character<br />
I(integer) Optional integer<br />
i Integer<br />
D(integer) Optional integer<br />
d Integer<br />
H(hex value) Optional hex number<br />
h Hex number<br />
O(octal value) Optional octal value<br />
o Octal value<br />
F(float) Optional floating point number<br />
f Floating point number<br />
G(float/INFINITY/-INFINITY/NAN/NAN_E) Optional float with IEEE definitions<br />
g Float with IEEE definitions<br />
{ Open quiet section<br />
} Close quiet section<br />
P&lt;delimiters&gt; Multiple delimiters change<br />
p&lt;delimiter&gt; Delimiter change<br />
Z(string)[length] Invalid optional string<br />
z(string)[length] Deprecated optional string<br />
S(string)[length] Optional string<br />
s[length] String<br />
U(any format number) Optional user (bot/player)<br />
u User (bot/player)<br />
Q(any format number) Optional bot (bot)<br />
q Bot (bot)<br />
R(any format number) Optional player (player)<br />
r Player (player)<br />
A&lt;type&gt;(default)[length] Optional array of given type<br />
a&lt;type&gt;[length] Array of given type<br />
E&lt;specification&gt;(default) Optional enumeration of given layout<br />
e&lt;specification&gt; Enumeration of given layout<br />
'string' Search string<br />
% Deprecated optional specifier prefix<br />
? Local options specifier</code></div></div><br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">"extract"</span></span></span></span></span><br />
<br />
I've written some (extendable) macros so you can do:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;&nbsp;else<br />{<br />?&nbsp;?return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">COLOUR_RED</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"FAIL!"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
This will compile as:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;<br />if&nbsp;(</span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"is[32]f"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">))<br />{<br />?&nbsp;?return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">COLOUR_RED</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"FAIL!"</span><span style="color: #007700">);<br />}&nbsp;<br /></span></code></div></div></div><br />
Note that "unformat" is the same as "sscanf", also note that the "SendClientMessage" part is optional:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;&nbsp;<br /></span></code></div></div></div><br />
Will simply compile as:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"is[32]f"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Basically it just simplifies sscanf a little bit (IMHO). I like new operators and syntax, hence this, examples:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">//&nbsp;An&nbsp;int&nbsp;and&nbsp;a&nbsp;float.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;An&nbsp;int&nbsp;and&nbsp;an&nbsp;OPTIONAL&nbsp;float.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">b&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">7.0</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;An&nbsp;int&nbsp;and&nbsp;a&nbsp;string.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">s</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">];<br /></span><span style="color: #FF8000">//&nbsp;An&nbsp;int&nbsp;and&nbsp;a&nbsp;playerid.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">;&nbsp;<br /></span></code></div></div></div><br />
As I say, the syntax is extendable, so to add hex numbers you would do:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">#define&nbsp;hex_EXTRO:%0##%1,%2|||%3=%9|||%4,%5)&nbsp;EXTRY:%0##%1H"("#%9")"#,%2,%3|||%4|||%5)<br />#define&nbsp;hex_EXTRN:%0##%1,%2|||%3|||%4,%5)&nbsp;EXTRY:%0##%1h,%2,%3|||%4|||%5)<br />#define&nbsp;hex_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5)&nbsp;EXTRY:%0##%1a&lt;h&gt;[%7],%2,%3|||%4|||%5)&nbsp;<br /></span></code></div></div></div><br />
That will add the tag "hex" to the system. Yes, the lines look complicated (because they are), but the ONLY things you need to change are the name before the underscore and the letter near the middle ("H", "h" and "a&lt;h&gt;" in the examples above for "optional", "required" and "required array" (no optional arrays yet besides strings)).<br />
<br />
New examples (with "hex" added):<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">//&nbsp;A&nbsp;hex&nbsp;number&nbsp;and&nbsp;a&nbsp;player.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;hex</span><span style="color: #007700">:</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;32&nbsp;numbers&nbsp;then&nbsp;32&nbsp;players.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">player</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">];<br /></span><span style="color: #FF8000">//&nbsp;11&nbsp;floats,&nbsp;an&nbsp;optional&nbsp;string,&nbsp;then&nbsp;an&nbsp;optional&nbsp;hex&nbsp;number.<br /></span><span style="color: #0000BB">extract&nbsp;params&nbsp;</span><span style="color: #007700">-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;Float</span><span style="color: #007700">:</span><span style="color: #0000BB">f</span><span style="color: #007700">[</span><span style="color: #0000BB">11</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">s</span><span style="color: #007700">[</span><span style="color: #0000BB">12</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #DD0000">"optional"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">hex</span><span style="color: #007700">:</span><span style="color: #0000BB">end&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">;&nbsp;<br /></span></code></div></div></div><br />
The code is actually surprisingly simple (I developed another new technique to simplify my "tag" macros and it paid off big style here). By default "Float", "string", "player" and "_" (i.e. no tag) are supported, and their individual letter definitions take up the majority of the code as demonstrated with the "hex" addition above. Note that "string:" is now used extensively in my code to differentiate from tagless arrays in cases like this, it is removed automatically but "player:" and "hex:" are not so you may wish to add:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #FF8000">#define&nbsp;player:<br />#define&nbsp;hex:&nbsp;<br /></span></code></div></div></div><br />
To avoid tag mismatch warnings (to remove them AFTER the compiler has used them to determine the correct specifier).<br />
<br />
The very first example had an "else", this will turn:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
In to:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"ii"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">))&nbsp;<br /></span></code></div></div></div><br />
You MUST put the "else" on the same line as "extract" for it to be detected, but then you can use normal single or multi-line statements. This is to cover common command use cases, you can even leave things on the same line:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">else&nbsp;return&nbsp;</span><span style="color: #0000BB">SendClientMessage</span><span style="color: #007700">(</span><span style="color: #0000BB">playerid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0xFF0000AA</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Usage:&nbsp;/cmd&nbsp;&lt;whatever&gt;"</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
There is now the ability to split by things other than space (i.e. adds "P&lt;?&gt;" to the syntax - updated from using "p" to "P"):<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">extract&nbsp;params</span><span style="color: #007700">&lt;|&gt;&nbsp;-&gt;&nbsp;</span><span style="color: #0000BB">new&nbsp;a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;&nbsp;<br /></span></code></div></div></div><br />
Will simply compile as:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string</span><span style="color: #007700">:</span><span style="color: #0000BB">b</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">Float</span><span style="color: #007700">:</span><span style="color: #0000BB">c</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">unformat</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"P&lt;|&gt;is[32]f"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
Note that for technical reasons you can use "&lt;-&gt;" (because it looks like the arrow after the "extract" keyword). You also can't use "&lt;;&gt;", "&lt;,&gt;", or "&lt;)&gt;" because of a bug with "#", but you can use any other character (most notably "&lt;|&gt;", as is popular with SQL scripts). I'm thinking of adding enums and existing variables (currently you HAVE to declare new variables), but not right now.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Errors/Warnings</span></span></span></span></span><br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">MSVRC100.dll not found</span></span></span></span><br />
</li>
</ul>
<br />
If you get this error, DO NOT just download the dll from a random website. This is part of the "Microsoft Visual Studio Redistributable Package". This is required for many programs, but they often come with it. Download it here:<br />
<br />
<a href="http://www.microsoft.com/download/en...s.aspx?id=5555" target="_blank" rel="noopener" class="mycode_url">http://www.microsoft.com/download/en...s.aspx?id=5555</a><br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: System not initialised</span></span></span></span><br />
</li>
</ul>
<br />
If you get this error, you need to make sure that you have recompiled ALL your scripts using the LATEST version of "sscanf2.inc". Older versions didn't really require this as they only had two natives - "sscanf" and "unformat", the new version has some other functions - you don't need to worry about them, but you must use "sscanf2.inc" so that they are correctly called. If you think you have done this and STILL get the error then try again - make sure you are using the correct version of PAWNO for example.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: String buffer overflow.</span></span></span></span><br />
</li>
</ul>
<br />
This error comes up when people try and put too much data in to a string. For example:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">[</span><span style="color: #0000BB">10</span><span style="color: #007700">];<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Hello&nbsp;there,&nbsp;how&nbsp;are&nbsp;you?"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"s[10]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
That code will try and put the string "Hello there, how are you?" in to the variable called "str". However, "str" is only 10 cells big and can thus only hold the string "Hello ther" (with a NULL terminator). In this case, the rest of the data is ignored - which could be good or bad:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">[</span><span style="color: #0000BB">10</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Hello&nbsp;there&nbsp;you|42"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"p&lt;|&gt;s[10]i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">num</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
In this case "num" is still correctly set to "42", but the warning is given for lost data ("e you").<br />
<br />
Currently there is nothing you can do about this from a programming side (you can't even detect it - that is a problem I intend to address), as long as you specify how much data a user should enter this will simply discard the excess, or make the destination variable large enough to handle all cases.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Optional types invalid in array specifiers, consider using 'A'.</span></span></span></span><br />
</li>
</ul>
<br />
A specifier such as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;I(5)&gt;[10]</code></div></div><br />
Has been written - here indicating an array of optional integers all with the default value "5". Instead you should use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;i&gt;(5)[10]</code></div></div><br />
This is an optional array of integers all with the default value "5", the advantage of this is that arrays can have multiple defaults:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;i&gt;(5, 6)[10]</code></div></div><br />
That will set the array to "5, 6, 7, 8, 9, 10, 11, 12, 13, 14" by default, incrementing by the found difference each time.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Optional types invalid in enum specifiers, consider using 'E'.</span></span></span></span><br />
</li>
</ul>
<br />
Similar to the previous warning, A specifier such as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;I(5)f&gt;</code></div></div><br />
Is invalid, instead use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;if&gt;(42, 11.0)</code></div></div><br />
This forces ALL the parts of an enum to be optional - anything less is not possible.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Multi-dimensional arrays are not supported.</span></span></span></span><br />
</li>
</ul>
<br />
This is not allowed:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"a&lt;a&lt;i&gt;[5]&gt;[10]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div><br />
A work-around can be done using:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">sscanf</span><span style="color: #007700">(</span><span style="color: #0000BB">params</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"a&lt;i&gt;[50]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">arr</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]);&nbsp;<br /></span></code></div></div></div><br />
That will correctly set up the pointers for the system.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Search strings are not supported in arrays.</span></span></span></span><br />
</li>
</ul>
<br />
This is not allowed (see the section on search strings):<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;'hello'i&gt;[10]</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Delimiters are not supported in arrays.</span></span></span></span><br />
</li>
</ul>
<br />
This is not allowed:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;p&lt;,&gt;i&gt;[10]</code></div></div><br />
Instead use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;,&gt;a&lt;i&gt;[10]</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Quiet sections are not supported in arrays.</span></span></span></span><br />
</li>
</ul>
<br />
<br />
This is not allowed:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>a&lt;{i}&gt;[10]</code></div></div><br />
Instead use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>{a&lt;i&gt;[10]}</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Unknown format specifier '?'.</span></span></span></span><br />
</li>
</ul>
<br />
The given specifier is not known (this post contains a full list of all the specifiers near the bottom).<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: 'Z' doesn't exist - that would be an optional, deprecated optional string!.</span></span></span></span><br />
</li>
</ul>
<br />
You used "Z", don't; instead use "S".<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: 'z' is deprecated, consider using 'S' instead.</span></span></span></span><br />
</li>
</ul>
<br />
<br />
You used "z", don't; instead use "S".<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Empty default values.</span></span></span></span><br />
</li>
</ul>
<br />
An optional specifier has been set as (for example):<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I()</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I(42)</code></div></div><br />
This does not apply to strings as they can be legitimately empty.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Unclosed default value.</span></span></span></span><br />
</li>
</ul>
<br />
You have a default value on an optional specifier that looks like:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I(42</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I(42)</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: No default value found.</span></span></span></span><br />
</li>
</ul>
<br />
You have no default value on an optional specifier:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>I(42)</code></div></div><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Unclosed specifier parameter, assuming '&lt;', consider using something like p&lt;&lt;&gt;.</span></span></span></span><br />
</li>
</ul>
<br />
A custom delimiter of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;</code></div></div><br />
Was found with no matching "&gt;" after one character. In this case the system assumes you are using the old (deprecated) style of delimiters and sets it to just "&lt;". Instead use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;,&gt;</code></div></div><br />
Or, if you really do want a delimiter of "&lt;" then use:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;&lt;&gt;</code></div></div><br />
Note that this does not need to be escaped; however, a delimiter of "&gt;" does:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;&#92;&gt;&gt;</code></div></div><br />
The "\" may also need to be escaped when writing actual PAWN strings, leading to:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;&#92;&#92;&gt;&gt;</code></div></div><br />
This also applies to array types ("a&lt;" vs "a&lt;i&gt;"), note that this will result in an invalid array type.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Unenclosed specifier parameters are deprecated, consider using something like p&lt;&lt;&gt;.</span></span></span></span><br />
</li>
</ul>
<br />
You are using the old style:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p,</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p&lt;,&gt;</code></div></div><br />
This also applies to array types ("ai" vs "a&lt;i&gt;").<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: No specified parameter found.</span></span></span></span><br />
</li>
</ul>
<br />
The format specifier just ends with:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>p</code></div></div><br />
This also applies to array types ("a" vs "a&lt;i&gt;").<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Missing string length end.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Missing length end.</span></span></span></span><br />
</li>
</ul>
<br />
A string has been written as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>s[10</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>s[10]</code></div></div><br />
I.e. the length has not been closed.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Arrays without a length are deprecated, please add a destination size.</span></span></span></span><br />
</li>
</ul>
<br />
A string has been written as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>s</code></div></div><br />
Instead of:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>s[10]</code></div></div><br />
I.e. the length has not been included.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Invalid data length.</span></span></span></span><br />
</li>
</ul>
<br />
An invalid array or string size has been specified (0, negative, or not a number).<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Invalid character in data length.</span></span></span></span><br />
</li>
</ul>
<br />
A string or array has been given a length that is not a number.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Strings without a length are deprecated, please add a destination size.</span></span></span></span><br />
</li>
</ul>
<br />
In the old system, strings were not required to have lengths but this introduced security problems with overflows. Now you must add a length or get the default of "32".<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: String/array must include a length, please add a destination size.</span></span></span></span><br />
</li>
</ul>
<br />
Arrays are newer than strings, so never had an implementation not requiring a length, so there is no compatability problems in REQUIRING a length to be given.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Can't have nestled quiet sections.</span></span></span></span><br />
</li>
</ul>
<br />
You have tried writing something like this:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>{i{x}}</code></div></div><br />
This has a quiet section ("{}") inside another one, which makes no sense.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Not in a quiet section.</span></span></span></span><br />
</li>
</ul>
<br />
"}" was found with no corresponding "{":<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>i}</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Can't remove quiet in enum.</span></span></span></span><br />
</li>
</ul>
<br />
This is caused by specifiers such as:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>{fe&lt;i}x&gt;</code></div></div><br />
Where the quiet section is started before the enum, but finishes part way through it rather than after it. This can be emulated by:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>{f}e&lt;{i}x&gt;</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Arrays are not supported in enums.</span></span></span></span><br />
</li>
</ul>
<br />
<br />
Basically, you can't do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;fa&lt;i&gt;[5]f&gt;</code></div></div><br />
You can, however, still do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>e&lt;fiiiiif&gt;</code></div></div><br />
This is a little more awkward, but is actually more technically correct given how enums are compiled.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Unclosed string literal.</span></span></span></span><br />
</li>
</ul>
<br />
A specifier starts a string with "'", but doesn't close it:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>i'hello</code></div></div><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: sscanf specifiers do not require '%' before them.</span></span></span></span><br />
</li>
</ul>
<br />
"format" uses code such as "%d", sscanf only needs "d", and confusingly the C equivalent function (also called "sscanf") DOES require "%". Sorry.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Insufficient default values.</span></span></span></span><br />
</li>
</ul>
<br />
Default values for arrays can be partially specified and the remainder will be inferred from the pattern of the last two:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>A&lt;i&gt;(0, 1)[10]</code></div></div><br />
That specifier will default to the numbers "0" to "9". However, because enums have a mixture of types, all the default values for "E" must ALWAYS be specified:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;iiff&gt;(0, 1, 0.0, 1.0)</code></div></div><br />
This will not do:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>E&lt;iiff&gt;(0, 1)</code></div></div><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Options are not supported in enums.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Options are not supported in arrays.</span></span></span></span><br />
</li>
</ul>
<br />
The "?" specifier for local options must appear outside any other specifier.<br />
<br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: No option value.</span></span></span></span><br />
</li>
</ul>
<br />
An option was specified with no value:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>?&lt;OLD_DEFAULT_NAME&gt;</code></div></div><br />
? ?<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: Unknown option name.</span></span></span></span><br />
</li>
</ul>
<br />
The given option was not recognised. Check spelling and case:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>?&lt;NOT_A_VALID_NAME=1&gt;</code></div></div><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf warning: Could not find function SSCANF:?.</span></span></span></span><br />
</li>
</ul>
<br />
A "k" specifier has been used, but the corresponding function could not be found. If you think it is there check the spelling matches exactly - including the case.<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: SSCANF_Init has incorrect parameters.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: SSCANF_Join has incorrect parameters.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: SSCANF_Leave has incorrect parameters.</span></span></span></span><br />
</li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf error: SSCANF_SetPlayerName has incorrect parameters.</span></span></span></span><br />
</li>
</ul>
<br />
You edited something in the sscanf2 include - undo it or redownload it.<br />
<br />
<span style="font-size: xx-large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">Changelog</span></span></span></span></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="color: red;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u"><span style="color: green;" class="mycode_color">sscanf 2.8.2 - 18/04/2015</span></span></span></span><br />
- Fixed a bug where "u" wasn't working correctly after a server restart.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Yet Another Lua Plugin]]></title>
			<link>https://forum.open.mp/showthread.php?tid=404</link>
			<pubDate>Sat, 20 Apr 2019 13:57:54 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=82">IllidanS4</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=404</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><a href="https://github.com/IllidanS4/YALP" target="_blank" rel="noopener" class="mycode_url">YALP v1.0</a></span></div>
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: small;" class="mycode_size"><a href="https://github.com/IllidanS4/YALP/releases/" target="_blank" rel="noopener" class="mycode_url">Download</a></span></span></div>
<div style="text-align: center;" class="mycode_align"><span style="font-size: small;" class="mycode_size"><a href="https://github.com/IllidanS4/YALP/wiki" target="_blank" rel="noopener" class="mycode_url">Tutorials</a></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
This plugin allows you to use Lua, your favourite dynamic flexible scripting language, in SA-MP, for all purposes, be it sandboxing user scripts, debugging the server, or developing filterscripts and gamemodes. <span style="font-style: italic;" class="mycode_i">YALP</span> provides lightweight and flexible Lua environment that can use existing or future natives from SA-MP or plugins.<br />
<br />
The main feature of <span style="font-style: italic;" class="mycode_i">YALP</span> is a powerful interop API to interact with existing Pawn natives and callbacks. It is very easy to call existing functions, <span style="font-style: italic;" class="mycode_i">without needing to declare them anywhere</span>:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>interop.native.SetPlayerPos(0, 1235.31, -2331.84, 12.33)</code></div></div><span style="font-style: italic;" class="mycode_i">YALP</span> automatically converts all arguments to their proper Pawn cells, and allows you to specify what the function returns in the actuall call. All standard cell and single-dimensional array types are supported.<br />
<br />
Callbacks can be specified in a similar simple way:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>function interop.public.OnPlayerConnect(playerid)<br />
  -- ...<br />
end</code></div></div><br />
Thanks to these mechanisms, you can use any framework you want, or build your own in Lua, without depending on new versions of this plugin.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Configuration</span><br />
There is no special XML, JSON or other configuration of this plugin, because you can specify everything when you create a new Lua state (you can create any number you wish, and run any code inside). You can specify what packages should be loaded or available in the Lua instance, how much maximum memory it should take, or even limit for how long Lua functions can run.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Features</span><br />
All standard Lua packages are available (although some of the more unsafe ones aren't allowed by default). The powerful interop package can interface with any Pawn native function or callback. There is also an advanced timer library with support for simple asynchronous functions (with Lua coroutines) and all sorts of timers. The remote package contains functions for remote communication between two separate Lua instance (via serialization or proxies).<br />
<br />
The standard Lua packages are also enhanced with a couple of useful functions. Please see the <span style="text-decoration: underline;" class="mycode_u"><a href="https://github.com/IllidanS4/YALP/wiki/Lua-API" target="_blank" rel="noopener" class="mycode_url">wiki</a></span> for a list of all new functions.<br />
<br />
The <span style="text-decoration: underline;" class="mycode_u"><a href="https://github.com/IllidanS4/YALP/wiki/Pawn-API" target="_blank" rel="noopener" class="mycode_url">Pawn API</a></span> is basically a port of the <span style="text-decoration: underline;" class="mycode_u"><a href="https://www.lua.org/manual/5.3/manual.html#4.8" target="_blank" rel="noopener" class="mycode_url">Lua C API</a></span>, allowing advanced manipulation of the Lua machine. It is recommended to use the Lua API, since it can do everything that Pawn can do, but if you need to interact with an existing complex Pawn library, it is possible as well.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Sample code</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;a_samp&gt;<br />
#include &lt;YALP&gt;<br />
<br />
public OnFilterScriptInit()<br />
{<br />
    new Lua:l = lua_newstate(); // creates a new Lua instance<br />
    <br />
    if(lua_loadfile(l, "script.lua")) // loads a Lua script and returns an error code<br />
    {<br />
        lua_stackdump(l); // prints the stack for more information about the error<br />
        return;<br />
    }<br />
    lua_bind(l); // binds the Lua instance to the current Pawn filterscript/gamemode, so all interation with it is rerouted to Lua<br />
    // if the binding succeeds, this code is not run (and the Lua instance is destroyed if the script is unloaded)<br />
    lua_stackdump(l);<br />
}</code></div></div><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>-- script.lua<br />
local interop = require "interop"<br />
interop.native.print("Hello from Lua!")</code></div></div>]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><a href="https://github.com/IllidanS4/YALP" target="_blank" rel="noopener" class="mycode_url">YALP v1.0</a></span></div>
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: small;" class="mycode_size"><a href="https://github.com/IllidanS4/YALP/releases/" target="_blank" rel="noopener" class="mycode_url">Download</a></span></span></div>
<div style="text-align: center;" class="mycode_align"><span style="font-size: small;" class="mycode_size"><a href="https://github.com/IllidanS4/YALP/wiki" target="_blank" rel="noopener" class="mycode_url">Tutorials</a></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
This plugin allows you to use Lua, your favourite dynamic flexible scripting language, in SA-MP, for all purposes, be it sandboxing user scripts, debugging the server, or developing filterscripts and gamemodes. <span style="font-style: italic;" class="mycode_i">YALP</span> provides lightweight and flexible Lua environment that can use existing or future natives from SA-MP or plugins.<br />
<br />
The main feature of <span style="font-style: italic;" class="mycode_i">YALP</span> is a powerful interop API to interact with existing Pawn natives and callbacks. It is very easy to call existing functions, <span style="font-style: italic;" class="mycode_i">without needing to declare them anywhere</span>:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>interop.native.SetPlayerPos(0, 1235.31, -2331.84, 12.33)</code></div></div><span style="font-style: italic;" class="mycode_i">YALP</span> automatically converts all arguments to their proper Pawn cells, and allows you to specify what the function returns in the actuall call. All standard cell and single-dimensional array types are supported.<br />
<br />
Callbacks can be specified in a similar simple way:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>function interop.public.OnPlayerConnect(playerid)<br />
  -- ...<br />
end</code></div></div><br />
Thanks to these mechanisms, you can use any framework you want, or build your own in Lua, without depending on new versions of this plugin.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Configuration</span><br />
There is no special XML, JSON or other configuration of this plugin, because you can specify everything when you create a new Lua state (you can create any number you wish, and run any code inside). You can specify what packages should be loaded or available in the Lua instance, how much maximum memory it should take, or even limit for how long Lua functions can run.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Features</span><br />
All standard Lua packages are available (although some of the more unsafe ones aren't allowed by default). The powerful interop package can interface with any Pawn native function or callback. There is also an advanced timer library with support for simple asynchronous functions (with Lua coroutines) and all sorts of timers. The remote package contains functions for remote communication between two separate Lua instance (via serialization or proxies).<br />
<br />
The standard Lua packages are also enhanced with a couple of useful functions. Please see the <span style="text-decoration: underline;" class="mycode_u"><a href="https://github.com/IllidanS4/YALP/wiki/Lua-API" target="_blank" rel="noopener" class="mycode_url">wiki</a></span> for a list of all new functions.<br />
<br />
The <span style="text-decoration: underline;" class="mycode_u"><a href="https://github.com/IllidanS4/YALP/wiki/Pawn-API" target="_blank" rel="noopener" class="mycode_url">Pawn API</a></span> is basically a port of the <span style="text-decoration: underline;" class="mycode_u"><a href="https://www.lua.org/manual/5.3/manual.html#4.8" target="_blank" rel="noopener" class="mycode_url">Lua C API</a></span>, allowing advanced manipulation of the Lua machine. It is recommended to use the Lua API, since it can do everything that Pawn can do, but if you need to interact with an existing complex Pawn library, it is possible as well.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Sample code</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;a_samp&gt;<br />
#include &lt;YALP&gt;<br />
<br />
public OnFilterScriptInit()<br />
{<br />
    new Lua:l = lua_newstate(); // creates a new Lua instance<br />
    <br />
    if(lua_loadfile(l, "script.lua")) // loads a Lua script and returns an error code<br />
    {<br />
        lua_stackdump(l); // prints the stack for more information about the error<br />
        return;<br />
    }<br />
    lua_bind(l); // binds the Lua instance to the current Pawn filterscript/gamemode, so all interation with it is rerouted to Lua<br />
    // if the binding succeeds, this code is not run (and the Lua instance is destroyed if the script is unloaded)<br />
    lua_stackdump(l);<br />
}</code></div></div><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>-- script.lua<br />
local interop = require "interop"<br />
interop.native.print("Hello from Lua!")</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Include] pawn-array-view: non-owning spans for multi-dimensional pawn arrays]]></title>
			<link>https://forum.open.mp/showthread.php?tid=316</link>
			<pubDate>Wed, 17 Apr 2019 05:00:54 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=36">Yashas</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=316</guid>
			<description><![CDATA[<span style="font-size: xx-large;" class="mycode_size">pawn-array-view</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">pawn-array-view</span> is an efficient C library that abstracts the <a href="https://github.com/YashasSamaga/AMX-Assembly-Docs/blob/master/DOCUMENT.md#multi-dimensional-arrays" target="_blank" rel="noopener" class="mycode_url">complex memory layout of multi-dimensional pawn arrays</a> and provides an intuitive C/ array-like interface for dealing with them. The name suggests that the library only allows read-only access to the arrays but that's not true; you can access and modify the arrays. Any decent C compiler will be able to optimize off all access and modifications to the arrays into simple pointer arithmetic. <br />
<br />
<span style="font-size: large;" class="mycode_size">Defects (Help Wanted)</span> <br />
LICM optimizations aren't pushing loop invariant subexpressions out of the loop because of aliased pointers. I haven't figured out how to correctly place restrict qualifiers which aren't ignored.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>int main() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;pawn::array_view&lt;int, 3&gt; array((cell*)0x10000);<br />
&nbsp;&nbsp;&nbsp;&nbsp;for(int i = 0; i &lt; 100; i) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(int j = 0; j &lt; 100; j) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(int k = 0; k &lt; 128; k) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array[i][j][k] = 10;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;return 0;<br />
}</code></div></div><br />
The compiler does not move the array[i][j] calculations outside the loop. There is a valid reason to not move them since modifying an element could modify something which would require recalculating the indexes. This is useful only when indirection tables are being modified. The common case is data being modified but not the indirection table. In this situation, moving the calculations out of the loop improves performance.<br />
<br />
There are more consequences. The compiler can also vectorize the loop if it manages to pull the subexpression out of the loop. The failure to move the subexpression outside the loop prevents a ton of optimizations.<br />
<br />
Note that the optimizations happen when the array is only being read. The problem is for modifications only.<br />
<br />
<span style="font-size: large;" class="mycode_size">Plans</span><br />
If the size of the arrays are known at compile-time, a better interface can be provided. I have plans on providing full-fledged container like support for arrays where the dimensions are available at compile time.<br />
<br />
There is a project going on in the develop branch which has working but inefficient code for dealing with known dimensions at run-time.<br />
<br />
I plan on renaming array_view to span. This include was initially providing a view but then the ability to mutate was added but the name wasn't changed. It's a very misleading name now.<br />
<br />
<span style="font-size: large;" class="mycode_size">Links</span><ul class="mycode_list"><li><a href="https://github.com/YashasSamaga/pawn-array-view/blob/master/lib/pawn/array_view.hpp" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">array_view.hpp</span></a><br />
</li>
<li><a href="https://github.com/YashasSamaga/pawn-array-view/blob/master/README.md" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">documentation</span></a><br />
</li>
<li><a href="https://github.com/YashasSamaga/pawn-array-view/blob/master/plugin/natives/tests.cpp" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">examples</span></a><br />
</li>
<li><a href="https://github.com/YashasSamaga/pawn-array-view" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">project repository</span></a><br />
</li>
<li><a href="https://github.com/YashasSamaga/pawn-array-view/tree/develop" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">develop branch (interesting stuff happens here)</span></a><br />
</li>
</ul>
]]></description>
			<content:encoded><![CDATA[<span style="font-size: xx-large;" class="mycode_size">pawn-array-view</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">pawn-array-view</span> is an efficient C library that abstracts the <a href="https://github.com/YashasSamaga/AMX-Assembly-Docs/blob/master/DOCUMENT.md#multi-dimensional-arrays" target="_blank" rel="noopener" class="mycode_url">complex memory layout of multi-dimensional pawn arrays</a> and provides an intuitive C/ array-like interface for dealing with them. The name suggests that the library only allows read-only access to the arrays but that's not true; you can access and modify the arrays. Any decent C compiler will be able to optimize off all access and modifications to the arrays into simple pointer arithmetic. <br />
<br />
<span style="font-size: large;" class="mycode_size">Defects (Help Wanted)</span> <br />
LICM optimizations aren't pushing loop invariant subexpressions out of the loop because of aliased pointers. I haven't figured out how to correctly place restrict qualifiers which aren't ignored.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>int main() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;pawn::array_view&lt;int, 3&gt; array((cell*)0x10000);<br />
&nbsp;&nbsp;&nbsp;&nbsp;for(int i = 0; i &lt; 100; i) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(int j = 0; j &lt; 100; j) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(int k = 0; k &lt; 128; k) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array[i][j][k] = 10;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;return 0;<br />
}</code></div></div><br />
The compiler does not move the array[i][j] calculations outside the loop. There is a valid reason to not move them since modifying an element could modify something which would require recalculating the indexes. This is useful only when indirection tables are being modified. The common case is data being modified but not the indirection table. In this situation, moving the calculations out of the loop improves performance.<br />
<br />
There are more consequences. The compiler can also vectorize the loop if it manages to pull the subexpression out of the loop. The failure to move the subexpression outside the loop prevents a ton of optimizations.<br />
<br />
Note that the optimizations happen when the array is only being read. The problem is for modifications only.<br />
<br />
<span style="font-size: large;" class="mycode_size">Plans</span><br />
If the size of the arrays are known at compile-time, a better interface can be provided. I have plans on providing full-fledged container like support for arrays where the dimensions are available at compile time.<br />
<br />
There is a project going on in the develop branch which has working but inefficient code for dealing with known dimensions at run-time.<br />
<br />
I plan on renaming array_view to span. This include was initially providing a view but then the ability to mutate was added but the name wasn't changed. It's a very misleading name now.<br />
<br />
<span style="font-size: large;" class="mycode_size">Links</span><ul class="mycode_list"><li><a href="https://github.com/YashasSamaga/pawn-array-view/blob/master/lib/pawn/array_view.hpp" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">array_view.hpp</span></a><br />
</li>
<li><a href="https://github.com/YashasSamaga/pawn-array-view/blob/master/README.md" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">documentation</span></a><br />
</li>
<li><a href="https://github.com/YashasSamaga/pawn-array-view/blob/master/plugin/natives/tests.cpp" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">examples</span></a><br />
</li>
<li><a href="https://github.com/YashasSamaga/pawn-array-view" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">project repository</span></a><br />
</li>
<li><a href="https://github.com/YashasSamaga/pawn-array-view/tree/develop" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">develop branch (interesting stuff happens here)</span></a><br />
</li>
</ul>
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[PAWN memory access plugin]]></title>
			<link>https://forum.open.mp/showthread.php?tid=253</link>
			<pubDate>Mon, 15 Apr 2019 11:35:00 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=9">BigETI</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=253</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: xx-large;" class="mycode_size"><span style="color: DarkSlateBlue;" class="mycode_color">PAWN memory access plugin</span></span><br />
<br />
<span style="color: Brown;" class="mycode_color">A successor to <a href="http://forum.sa-mp.com/showthread.php?t=451381" target="_blank" rel="noopener" class="mycode_url">http://forum.sa-mp.com/showthread.php?t=451381</a></span></div>
<br />
<span style="font-size: x-large;" class="mycode_size"><br />
<br />
<span style="color: RoyalBlue;" class="mycode_color">Description</span></span><br />
<br />
The PAWN memory access plugin allows to allocate and free memory from heap in PAWN.<br />
<br />
<span style="font-size: x-large;" class="mycode_size"><br />
<br />
<span style="color: RoyalBlue;" class="mycode_color">Project</span></span><br />
<br />
All of the source code, builds and documentations are located at <a href="https://github.com/BigETI/pawn-memory" target="_blank" rel="noopener" class="mycode_url">GitHub</a>: <a href="https://github.com/BigETI/pawn-memory" target="_blank" rel="noopener" class="mycode_url">https://github.com/BigETI/pawn-memory</a>]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: xx-large;" class="mycode_size"><span style="color: DarkSlateBlue;" class="mycode_color">PAWN memory access plugin</span></span><br />
<br />
<span style="color: Brown;" class="mycode_color">A successor to <a href="http://forum.sa-mp.com/showthread.php?t=451381" target="_blank" rel="noopener" class="mycode_url">http://forum.sa-mp.com/showthread.php?t=451381</a></span></div>
<br />
<span style="font-size: x-large;" class="mycode_size"><br />
<br />
<span style="color: RoyalBlue;" class="mycode_color">Description</span></span><br />
<br />
The PAWN memory access plugin allows to allocate and free memory from heap in PAWN.<br />
<br />
<span style="font-size: x-large;" class="mycode_size"><br />
<br />
<span style="color: RoyalBlue;" class="mycode_color">Project</span></span><br />
<br />
All of the source code, builds and documentations are located at <a href="https://github.com/BigETI/pawn-memory" target="_blank" rel="noopener" class="mycode_url">GitHub</a>: <a href="https://github.com/BigETI/pawn-memory" target="_blank" rel="noopener" class="mycode_url">https://github.com/BigETI/pawn-memory</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SAMP GameMode in Assembly (SGMA)]]></title>
			<link>https://forum.open.mp/showthread.php?tid=221</link>
			<pubDate>Sun, 14 Apr 2019 23:45:52 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=444">EvgeN 1137</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=221</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">SAMP GameMode in Assembly (SGMA)</span></span></div>
<br />
<br />
<br />
<br />
<br />
SGMA is the first SAMP gamemode written entirely in assembly programming language using fasm<br />
<br />
<br />
<br />
Technical features:<br />
<ul class="mycode_list"><li>As fast as it gets: doesn't use an AMX machine, runs on native x86 code<br />
<br />
</li>
<li>Cross-platform: in assembly, yeah!<br />
<br />
</li>
</ul>
<br />
Gamemode features:<br />
<ul class="mycode_list"><li>Simple Deathmatch<br />
<br />
</li>
<li>SQLite-based account system<br />
<br />
</li>
<li>Weapon store<br />
<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/evgen1137/SGMA/releases/tag/1.0" target="_blank" rel="noopener" class="mycode_url">Download page</a></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/evgen1137/SGMA/" target="_blank" rel="noopener" class="mycode_url">GitHub page</a></span><br />
<br />
Also please read the <a href="https://github.com/evgen1137/SGMA/blob/master/NOTES.md" target="_blank" rel="noopener" class="mycode_url">technical and development notes (click)</a>]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">SAMP GameMode in Assembly (SGMA)</span></span></div>
<br />
<br />
<br />
<br />
<br />
SGMA is the first SAMP gamemode written entirely in assembly programming language using fasm<br />
<br />
<br />
<br />
Technical features:<br />
<ul class="mycode_list"><li>As fast as it gets: doesn't use an AMX machine, runs on native x86 code<br />
<br />
</li>
<li>Cross-platform: in assembly, yeah!<br />
<br />
</li>
</ul>
<br />
Gamemode features:<br />
<ul class="mycode_list"><li>Simple Deathmatch<br />
<br />
</li>
<li>SQLite-based account system<br />
<br />
</li>
<li>Weapon store<br />
<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/evgen1137/SGMA/releases/tag/1.0" target="_blank" rel="noopener" class="mycode_url">Download page</a></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/evgen1137/SGMA/" target="_blank" rel="noopener" class="mycode_url">GitHub page</a></span><br />
<br />
Also please read the <a href="https://github.com/evgen1137/SGMA/blob/master/NOTES.md" target="_blank" rel="noopener" class="mycode_url">technical and development notes (click)</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[samp-crypto - bcrypt, scrypt & argon2 hashing]]></title>
			<link>https://forum.open.mp/showthread.php?tid=219</link>
			<pubDate>Sun, 14 Apr 2019 23:40:58 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.open.mp/member.php?action=profile&uid=457">Bork</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.open.mp/showthread.php?tid=219</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b"><span style="font-size: xx-large;" class="mycode_size">samp crypto</span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: -apple-system, BlinkMacSystemFont,;" class="mycode_font">A SAMP cryptography plugin written in Rust. This plugin was written as a means to make it really simple for anyone to transition from Whirlpool, SHA256_PassHash or any other hashing method similar to these without major script changes, like the other bcrypt plugins do. This is my first plugin written in Rust, I tried cleaning up all my code and I will continue to do so however you may still see some older code. If you wish to clean it up please fork the repo, make changes and create a PR! I will happily review and accept it.</span></span></span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: -apple-system, BlinkMacSystemFont,;" class="mycode_font"><img src="https://img.shields.io/github/downloads/infin1tyy/samp-crypto/total.svg" loading="lazy"  alt="[Image: total.svg]" class="mycode_img" /> <img src="https://img.shields.io/github/issues/infin1tyy/samp-crypto.svg" loading="lazy"  alt="[Image: samp-crypto.svg]" class="mycode_img" /> <img src="https://img.shields.io/github/release/infin1tyy/samp-crypto.svg" loading="lazy"  alt="[Image: samp-crypto.svg]" class="mycode_img" /></span></span></span></span><br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: -apple-system, BlinkMacSystemFont,;" class="mycode_font"><span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Encryption Methods</span></span></span></span></span></span><ul class="mycode_list"><li><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size">Bcrypt</span></span><br />
</li>
<li><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size">Scrypt</span></span><br />
</li>
<li><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size">Argon2i (Argon2d and 2id will be brought out soon if demand is there)</span></span><br />
</li>
</ul>
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Installation</span></span><ul class="mycode_list"><li>Head to the release page and download the latest version of samp crypto (<a href="https://github.com/infin1tyy/samp-crypto/releases" target="_blank" rel="noopener" class="mycode_url"><span style="color: #0366d6;" class="mycode_color">https://github.com/infin1tyy/samp-crypto/releases</span></a>).<br />
<br />
</li>
<li>Place the .inc into your pawno/include folder.<br />
<br />
</li>
<li>Place the .dll or .so in your plugins folder (if one doesn't exist, create a new one).<br />
<br />
</li>
<li>Add?samp_crypto?to your server.cfg (if on linux, add?libsamp_crypto.so?to your server.cfg instead.<br />
<br />
</li>
<li>Enjoy!<br />
</li>
</ul>
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">How to Use</span></span><br />
<a href="https://github.com/infin1tyy/samp-crypto/wiki" target="_blank" rel="noopener" class="mycode_url">Click me to go to the wiki!</a><br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Downloads</span></span><br />
<a href="https://github.com/infin1tyy/samp-crypto/releases" target="_blank" rel="noopener" class="mycode_url">Binaries</a><br />
<a href="https://github.com/infin1tyy/samp-crypto" target="_blank" rel="noopener" class="mycode_url">Source Code</a><br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Credits</span></span><br />
The credits can be found?<a href="https://github.com/infin1tyy/samp-crypto/blob/master/README.md" target="_blank" rel="noopener" class="mycode_url">here</a>, in the GitHub README.md<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Notes</span></span><br />
I was debating whether or not I should release this for a while. After what has been going on in SAMP, with essentially the community being divided between the players in the Discord and the SAMP forum, I wasn't sure who to support. A lot of the people from this community have been quite spiteful towards me, however, I'm putting that in the past and I suppose my support is with you lot.<br />
samp crypto will be a burgershot.gg exclusive.<br />
Special thanks to iAmir &amp; Dakyskye from the bottom of my heart.<br />
For anyone who didn't believe in me, fuck you I suppose. :joy: Maybe this'll prove I'm worth something. And I'd like to apologize for never delivering on that Postgres plugin, but do know that I still have it in mind and I'll make it happen whenever I have the experience to do so.]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b"><span style="font-size: xx-large;" class="mycode_size">samp crypto</span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: -apple-system, BlinkMacSystemFont,;" class="mycode_font">A SAMP cryptography plugin written in Rust. This plugin was written as a means to make it really simple for anyone to transition from Whirlpool, SHA256_PassHash or any other hashing method similar to these without major script changes, like the other bcrypt plugins do. This is my first plugin written in Rust, I tried cleaning up all my code and I will continue to do so however you may still see some older code. If you wish to clean it up please fork the repo, make changes and create a PR! I will happily review and accept it.</span></span></span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: -apple-system, BlinkMacSystemFont,;" class="mycode_font"><img src="https://img.shields.io/github/downloads/infin1tyy/samp-crypto/total.svg" loading="lazy"  alt="[Image: total.svg]" class="mycode_img" /> <img src="https://img.shields.io/github/issues/infin1tyy/samp-crypto.svg" loading="lazy"  alt="[Image: samp-crypto.svg]" class="mycode_img" /> <img src="https://img.shields.io/github/release/infin1tyy/samp-crypto.svg" loading="lazy"  alt="[Image: samp-crypto.svg]" class="mycode_img" /></span></span></span></span><br />
<br />
<span style="font-size: small;" class="mycode_size"><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: -apple-system, BlinkMacSystemFont,;" class="mycode_font"><span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Encryption Methods</span></span></span></span></span></span><ul class="mycode_list"><li><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size">Bcrypt</span></span><br />
</li>
<li><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size">Scrypt</span></span><br />
</li>
<li><span style="color: #24292e;" class="mycode_color"><span style="font-size: small;" class="mycode_size">Argon2i (Argon2d and 2id will be brought out soon if demand is there)</span></span><br />
</li>
</ul>
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Installation</span></span><ul class="mycode_list"><li>Head to the release page and download the latest version of samp crypto (<a href="https://github.com/infin1tyy/samp-crypto/releases" target="_blank" rel="noopener" class="mycode_url"><span style="color: #0366d6;" class="mycode_color">https://github.com/infin1tyy/samp-crypto/releases</span></a>).<br />
<br />
</li>
<li>Place the .inc into your pawno/include folder.<br />
<br />
</li>
<li>Place the .dll or .so in your plugins folder (if one doesn't exist, create a new one).<br />
<br />
</li>
<li>Add?samp_crypto?to your server.cfg (if on linux, add?libsamp_crypto.so?to your server.cfg instead.<br />
<br />
</li>
<li>Enjoy!<br />
</li>
</ul>
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">How to Use</span></span><br />
<a href="https://github.com/infin1tyy/samp-crypto/wiki" target="_blank" rel="noopener" class="mycode_url">Click me to go to the wiki!</a><br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Downloads</span></span><br />
<a href="https://github.com/infin1tyy/samp-crypto/releases" target="_blank" rel="noopener" class="mycode_url">Binaries</a><br />
<a href="https://github.com/infin1tyy/samp-crypto" target="_blank" rel="noopener" class="mycode_url">Source Code</a><br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Credits</span></span><br />
The credits can be found?<a href="https://github.com/infin1tyy/samp-crypto/blob/master/README.md" target="_blank" rel="noopener" class="mycode_url">here</a>, in the GitHub README.md<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Notes</span></span><br />
I was debating whether or not I should release this for a while. After what has been going on in SAMP, with essentially the community being divided between the players in the Discord and the SAMP forum, I wasn't sure who to support. A lot of the people from this community have been quite spiteful towards me, however, I'm putting that in the past and I suppose my support is with you lot.<br />
samp crypto will be a burgershot.gg exclusive.<br />
Special thanks to iAmir &amp; Dakyskye from the bottom of my heart.<br />
For anyone who didn't believe in me, fuck you I suppose. :joy: Maybe this'll prove I'm worth something. And I'd like to apologize for never delivering on that Postgres plugin, but do know that I still have it in mind and I'll make it happen whenever I have the experience to do so.]]></content:encoded>
		</item>
	</channel>
</rss>