samp.directory
← Skrypty i biblioteki

dinhkhoi2298/menu

FMenu (Fix)

Biblioteka★ 8zaktualizowano kwi 2021Brak licencjiPawnsampctl
Otwórz na GitHubie

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 dinhkhoi2298/menu

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

Menu

Installation

Simply install to your project:

sampctl package install roesanne26/menu

Include in your code and begin using the library:

#include <menu>

Functions

Menu_Add(playerid, const item[26])
Menu_SetColor(playerid, color)
Menu_Show(playerid, menuid, const tittle[] = "Menu", const header[] = "Interaction")
Menu_Hide(playerid)

Usage

#include <Pawn.CMD>
#include <menu>

stock HexReturn(rr, gg, bb, aa)
{
	return (aa & 0xFF) | ((bb & 0xFF) << 8) | ((gg & 0xFF) << 16) | (rr << 24);
}

CMD:ya(playerid, params[])
{
    if(Menu_Showing(playerid))
        return 1;

    for(new str[26], i = 0; i < strval(params) + 1; i ++)
    {
        format(str, 26, "Item %d", i);
        Menu_Add(playerid, str);
    }
    TogglePlayerControllable(playerid, 0);
    Menu_SetColor(playerid, HexReturn(51, 153, 255, 200)); // Dodger Blue
    Menu_Show(playerid, 1, "HELLO YOOY!", "Interaction");
    return 1;
} 

public OnMenuResponse(playerid, menuid, response, listitem)
{
    new 
        str[128];
    
    format(str, sizeof(str), "Menu=%d, Response=%d, Listitem=%d", menuid, response, listitem);
    SendClientMessage(playerid, -1, str);
    if(!response)
    {
        Menu_Hide(playerid);
        TogglePlayerControllable(playerid, 1);
    }
    return 1;
}

To test, simply run the package:

sampctl package run

Credits

  • Me

librarysa-mp-librarysampctl

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

dinhkhoi2298/menu: Biblioteka SA-MP | samp.directory