samp.directory
← Scripts et bibliothèques

ScavengeSurvive/item-dictionary

Pas de description sur GitHub.

Bibliothèque★ 2mis à jour oct. 2020Pas de licencePawnsampctl
Ouvrir sur GitHub

Ce dépôt n’a pas de fichier de licence. Il est public en lecture, mais cela ne donne pas à lui seul le droit de le réutiliser.

Installer avec sampctl

sampctl package install ScavengeSurvive/item-dictionary

Lance ceci dans le dossier de ton projet. sampctl télécharge le paquet et ce dont il dépend.

L’essayer dans le compilateur Pawn →

Ajoute ses fichiers include, avec les bibliothèques dont il dépend, au compilateur Pawn de ton navigateur, prêts à être inclus dans un script.

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

Cette page est construite à partir de ce que GitHub publie sur le dépôt. samp.directory n’héberge pas le code. Signaler un problème avec cette fiche

ScavengeSurvive/item-dictionary : Bibliothèque SA-MP | samp.directory