samp.directory
← Skripte und Bibliotheken

TommyB123/textdraw-binding

SA-MP/open.mp library to bind textdraw clicks to exclusive callbacks with additional data

Bibliothek★ 3aktualisiert Jan. 2026Keine 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 TommyB123/textdraw-binding

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

textdraw-binding

This is a simple SA-MP/open.mp library that adds two functions to bind global and per-player textdraws to specific callback and pass along extra IDs to it.

Example:

// bind a preview model box to the OnPlayerClickCharacterTextdraw callback while passing along the ID of the respective character
BindPlayerTextdrawToCallback(playerid, CharacterSelectionBoxes[playerid][x], "OnPlayerClickCharacterTextdraw", characterIDs[x]);

//create a custom callback for the textdraw click. note the characterid argument.
forward OnPlayerClickCharacterTextdraw(playerid, PlayerText:textdraw, characterid);
public OnPlayerClickCharacterTextdraw(playerid, PlayerText:textdraw, characterid)
{
	CancelSelectTextDraw(playerid);

	TextDrawHideForPlayer(playerid, CharacterSelectionMain);
	TextDrawHideForPlayer(playerid, CharacterSelectionLogout);
	DestroyCharacterSelectionTDs(playerid);

	CharacterLogin(playerid, characterid, FetchCharacterName(characterid)); //using the characterid argument we passed from BindPlayerTextdrawToCallback!
}

Dependencies

This library requires the following dependencies.

Installation

Simply install to your project:

sampctl install TommyB123/textdraw-binding

Include in your code and begin using the library:

#include <textdraw-binding>

Functions

BindTextdrawToCallback(Text:textdraw, const callback[], extravalue = 0)

Binds a global textdraw to a callback. The callback in question must have 3 arguments to accommodate for the extra value being passed along.

BindPlayerTextdrawToCallback(playerid, PlayerText:textdraw, const callback[], extravalue = 0)

Binds a per-player textdraw to a callback. The callback in question must have 3 arguments to accommodate for the extra value being passed along.

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

TommyB123/textdraw-binding: SA-MP Bibliothek | samp.directory