Library★ 8updated Apr 2021No licencePawnsampctl
Open on GitHubThis repository has no licence file. It is public to read, but that alone does not give permission to reuse it.
Install with sampctl
sampctl package install dinhkhoi2298/menu
Run this in your project folder. sampctl downloads the package and what it depends on.
Try it in the Pawn compiler →
Adds its include files, with the libraries it depends on, to the Pawn compiler in your browser, ready to include in a script.
Depends on 2 packages
- sampctl/samp-stdlibnot in this directory
- pawn-lang/YSI-Includes★ 227
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
This page is built from what GitHub publishes about the repository. samp.directory does not host the code. Report a problem with this listing