samp.directory
← Skrypty i biblioteki

AGraber/pawn-plus-hooks

Macro helpers for public and native function hooking

Biblioteka★ 9zaktualizowano lut 2022Brak licencjiPawnsampctlZarchiwizowane
Otwórz na GitHubie

Autor zarchiwizował to repozytorium, więc nie jest już rozwijane.

To repozytorium nie ma pliku licencji. Jest publiczne do odczytu, ale samo to nie daje pozwolenia na ponowne użycie.

Zainstaluj za pomocą sampctl

sampctl package install AGraber/pawn-plus-hooks

Uruchom to w folderze swojego projektu. sampctl pobiera pakiet i to, od czego zależy.

Wypróbuj w kompilatorze Pawn →

Dodaje jej pliki include, razem z bibliotekami, od których zależy, do kompilatora Pawn w twojej przeglądarce, gotowe do dołączenia w skrypcie.

Zależy od 2 pakietów

README.md

pawn-plus-hooks

Installation

Simply install to your project:

sampctl package install AGraber/pawn-plus-commands

Include in your code and begin using the library:

#include <PawnPlusCMD>

Usage

If you're familiar with y_hooks then the syntax will be familiar:

#include <pp-hooks>
hook OnPlayerEnterDynArea(playerid, areaid)
{
    new string[145];
    format(string, sizeof string, "You entered area id %d", areaid);
    SendClientMessage(playerid, -1, string);
}


#include <pp-hooks>
hook OnPlayerEnterDynArea(playerid, areaid)
{
    printf("playerid %d entered areaid %d", playerid, areaid);
}

hook native SetPlayerPos(playerid, Float:x, Float:y, Float:z)
{
    // Not recursive: calls next hook or the native
    return SetPlayerPos(playerid, x, y, z + 1.0);
}

hook ret OnPlayerUpdate(&ret, playerid)
{
    if(IsPlayerCheating(playerid))
    {
        // set return to 0 to desync
        ret = 0;
        // return non-zero to use that ret value
        return 1;
    }
}

You can change the default hook method (used by the hook and hook public macros) by defining PP_DEFAULT_PUBLIC_HOOK_METHOD to the desired method.

If the hook returns a non-zero value, the following hooks and the base callback won't be executed and that value (or the one at ret if it's a ret hook) will be returned.

Thanks

  • Y_Less: YSI macros used for reference
  • IllidanS4: PawnPlus

Ta strona jest zbudowana z tego, co GitHub publikuje o repozytorium. samp.directory nie hostuje kodu. Zgłoś problem z tym wpisem

AGraber/pawn-plus-hooks: Biblioteka SA-MP | samp.directory