samp.directory
← Skripte und Bibliotheken

ScavengeSurvive/itemtype-bag

Provides an item type definition for wearable containers so players can carry multiple items with them.

Bibliothek★ 2aktualisiert Okt. 2020MITPawnsampctl
Auf GitHub öffnen

Mit sampctl installieren

sampctl package install ScavengeSurvive/itemtype-bag

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.

README.md

Bag Items

Provides an item type definition for wearable containers so players can carry multiple items with them.

Installation

Simply install to your project:

sampctl package install ScavengeSurvive/itemtype-bag

Include in your code and begin using the library:

#include <bag>

Usage

Use DefineBagType to define the given ItemType as a bag item with the specified name and attachment offsets. The attachment offsets are used for attaching the bag to the spine bone when the player wears the bag.

You can use GivePlayerBag to make a player wear a bag item and RemovePlayerBag to remove it.

DestroyPlayerBag destroys the player's currently worn bag item along with all the contained items.

While giving items to a player, you can use the helper function AddItemToPlayer which determines whether to place the given item into the player's inventory or their bag.

Testing

To test, simply run the package:

sampctl package run

And connect to localhost:7777 to test.

inventory-systempawn-packagesa-mpsa-mp-library

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/itemtype-bag: SA-MP Bibliothek | samp.directory