Repository navigation
First public release. The plugin was rewritten on top of rust-samp v3.0.0: a single artifact now loads on SA-MP and on Open Multiplayer (native component or legacy mode). Every native from the 1.x line is preserved, with a large API expansion and a standardized, documented packaging.
Added
- Universal binary. One
.so/.dllruns on SA-MP and on Open Multiplayer. open.mp auto-loads it as a native component when dropped intocomponents/(noconfig.jsonentry required), or in legacy mode fromplugins/when declared underpawn.legacy_plugins. - Standalone arrays.
json_create_arraycreates an array handle;json_array_append(raw JSON) plus typedjson_array_append_string,json_array_append_int,json_array_append_float,json_array_append_bool,json_array_append_null; andjson_array_remove. - Typed array-of-objects getters.
json_array_get_int,json_array_get_float,json_array_get_bool— completing the existingjson_array_get_string. - Typed path setters.
json_set_string_at,json_set_int_at,json_set_float_at,json_set_bool_at,json_set_null_at— set deep values without building a JSON string. - Null setters.
json_set_null(by key) andjson_set_null_at(by path). - Pretty serialization.
json_to_string_pretty(indented), alongside the compactjson_to_string. - Handle-level operations.
json_clone(deep copy),json_clear(empty in place),json_merge(deep object merge),json_equals(structural compare),json_count(open handles, for leak hunting),json_is_array,json_is_object. - Logging controls.
json_lognative withJSON_LOG_*levels (none/error/warning/info/all); messages go to the console andlogs/json_samp.log, behind a startup banner. - Include constants.
JSON_SAMP_VERSIONplus theJSON_TYPE_*andJSON_LOG_*enums, shipped injson_samp.inc.
Changed
- Path integer/float getters coerce booleans.
json_get_int_at/json_get_float_atnow read a JSON boolean as0/1, matching the write side. The level-1 getters (json_get_int/json_get_float) stay strict (number or numeric string only). - Stable error codes. Failures log a coded message (
E001–E058) with a severity (error for hard failures, warning for recoverable misuse). File and parse errors print a concise console line and keep the full technical cause inlogs/json_samp.log. See docs/errors.md. - Include standardized. The Pawn include is now
json_samp.incwith#pragma library json_samp, generated from a template at build time so it always tracks the crate version. Update your script to#include <json_samp>. - Consistent artifact names. Releases ship raw
json_samp.so,json_samp.dllandjson_samp.inc, identically named across Linux and Windows. - Documentation. Rewritten in English as a MkDocs Material site, with per-feature guides, a full API reference and an error-code table. Runnable Pawn snippets live under
examples/. - License. Distributed under the AGPL-3.0-or-later.
Migration from 1.x
- Replace
#include <a_json>with#include <json_samp>. - Load the plugin as
json_samp(plugins json_samp.soon SA-MP;components/orlegacy_pluginson open.mp). - No existing native was removed or renamed — only additions and the include/packaging changes above.
Full Changelog: https://github.com/NullSablex/json-samp/commits/v2.0.0
Artifacts
json_samp.so— Linux i686 (i686-unknown-linux-gnu).json_samp.dll— Windows i686 (i686-pc-windows-msvc).json_samp.inc— Pawn include, identical file for SA-MP and Open Multiplayer.
The same .so / .dll runs on SA-MP and on Open Multiplayer (native component or legacy). Installation paths: see docs/installation.md.