samp.directory
← Skripte und Bibliotheken

ScavengeSurvive/item-dictionary

Keine Beschreibung auf GitHub.

Bibliothek★ 2aktualisiert Okt. 2020Keine LizenzPawnsampctl
Auf GitHub öffnen

Dieses Repository hat keine Lizenzdatei. Es ist öffentlich lesbar, aber das allein gibt noch keine Erlaubnis, es weiterzuverwenden.

Mit sampctl installieren

sampctl package install ScavengeSurvive/item-dictionary

Führe das in deinem Projektordner aus. sampctl lädt das Paket und alles herunter, wovon es abhängt.

Im Pawn-Compiler ausprobieren →

Fügt seine Include-Dateien samt der Bibliotheken, von denen es abhängt, dem Pawn-Compiler in deinem Browser hinzu, bereit zum Einbinden in ein Skript.

Hängt von 5 Paketen ab

README.md

item-dictionary

A successor to item-array-data, this package provides items with a dynamically allocated dictionary-style data storage.

Store arbitrary data to items using strings as keys. Backed by BigETI/pawn-map for dynamically allocated hash tables.

Installation

Simply install to your project:

sampctl package install ScavengeSurvive/item-dictionary

Include in your code and begin using the library:

#include <item-dictionary>

Usage

The data accessors are very simple:

SetItemFieldT(Item:id, field[], value)

Where T is one of Int, Float, Array or String.

Sets the specified field to value. Optional length argument is provided for Array variant.

Returns 0 on success, 1 if the item ID is invalid.

GetItemFieldT(Item:id, field[], &value)

Where T is one of Int, Float, Array or String..

Stores to value the data held in the item's dictionary addressed by field. Optional length argument is provided for Array and String variants.

Returns 0 on success, 1 if the item ID is invalid, 2 if the item exists but does not have any data stored with it and 3 if the item exists, has data but does not contain an entry for the specified field.

GetItemFieldsAsJSON(Item:id, &Node:node)

Encodes an item dictionary to Node:node for use with JSON and Requests API.

Testing

To test, simply run the package:

sampctl package run

pawn-packagesa-mpsa-mp-libraryscavenge-survive

Diese Seite wird aus dem erstellt, was GitHub über das Repository veröffentlicht. samp.directory hostet den Code nicht. Ein Problem mit diesem Eintrag melden

ScavengeSurvive/item-dictionary: SA-MP Bibliothek | samp.directory