samp.directory
← Skripte und Bibliotheken

Mergevos/samp-pp-specifiers

Keine Beschreibung auf GitHub.

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

Mit sampctl installieren

sampctl package install Mergevos/samp-pp-specifiers

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 2 Paketen ab

README.md

samp-pp-specifiers

Make your specifiers with PawnPlus plugin.

Installation

Simply install to your project:

sampctl package install Mergevos/samp-pp-specifiers

Include in your code and begin using the library:

#include <pp-specifiers>

Usage

Register your own specifiers with this function:

stock PP_RegisterSpecifier(specifier, const handler[], bool:is_string=false)

//Example

PP_RegisterSpecifier('g', "SomeCallbackToHandle", false);

print_s(str_format("He is %g connected.", playerid));

forward String: SomeCallbackToHandle(playerid, type, String: format);
public String: SomeCallbackToHandle(playerid, type, String: format)
{
  if(!IsPlayerConnected(playerid))
  {
    return str_new("Not connected");
  }
  return str_new("Connected");
}

Firstly, we register specifier character with handler function, and our specifier doesn't accept normal strings, so you can't specify NORMAL (not PawnPlus) string instead of playerid. print_s part is pretty straightforward.

public String: SomeCallbackToHandle(playerid, type, String: format) is handler. It is basically a function which handles the specifier. type is character of the specifier, in this case it is g. String: format is pawnplus string of everything you input in front of specifier, eg. %03g, will make format 03.

New SpecifiersWhat does it do?
%aReturns modelid from vehicleid.
%mVehicle name from modelid.
%MVehicle name from modelid (used in sentence).
%wWeapon name from weaponid.
%WWeapon name from weaponid (used in sentence).

Testing

To test, simply run the package:

sampctl package run

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

Mergevos/samp-pp-specifiers: SA-MP Bibliothek | samp.directory