Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/httpRick/SA-Menu
https://github.com/httpRick/SA-Menu
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/httpRick/SA-Menu
- Owner: httpRick
- Created: 2019-09-12T20:41:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-24T22:10:04.000Z (over 5 years ago)
- Last Synced: 2023-11-02T20:29:56.592Z (about 1 year ago)
- Language: Lua
- Size: 1.93 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mta-sa - SA Menu - GTA:SA like menu. (Libs and utils)
README
# San Andreas Menu (SA-MENU)
### Screen:
[![Actions Status](https://github.com/httpRick/SA-Menu/blob/master/screen.svg)](https://github.com/github/SA-Menu/actions)## Client Functions
### createMenu
Paramters:
* float position X
* float position Y
* string title Menu
* strint type Menu 'default or shop' is the default mode is automatically selected
returns the created Menu```lua
createMenu(85, 350, "Example Menu")
```### createItem
Paramters:
* element Menu
* string left Item
* string right Item
returns the created Menu item```lua
local theMenu = createMenu(85, 350, "Example Menu")
createItem(theMenu, "Left item", "Right item")
```### destroyMenu
Paramters:
* element Menu
returns true if the item is destroyed returns false if no item is found
```lua
local theMenu = createMenu(85, 350, "Example Menu")
destroyMenu(theMenu)
```### showMenu
Paramters:
* element Menu
returns true if the item is destroyed returns false if no item is found
```lua
local theMenu = createMenu(85, 350, "Example Menu")
showMenu(theMenu)
```### hiddenMenu
Paramters:
* element Menu
returns true if the item is destroyed returns false if no item is found
```lua
local theMenu = createMenu(85, 350, "Example Menu")
hiddenMenu(theMenu)
```### setMenuType
Paramters:
* element Menu
* string Menu type
Available menu types are: "default", "shop"
returns true if a good type is input, otherwise false
```lua
local theMenu = createMenu(85, 350, "Example Menu")
setTypeMenu(theMenu, "shop")
```
### setMenuColumn
Paramters:
* element Menu
* string left column
* string right column🔴 Only for the store type
```lua
local theMenu = createMenu(85, 350, "Example Menu")
setTypeMenu(theMenu, "shop")
setMenuColumn(theMenu, "Products", "Price")
```## Clientside event
### onClientMenuSelect
Paramters:
* string Item1
* string Item2returns the item that has been selected
```lua
function exampleSelect(theItem1, theItem2)
print(theItem1, theItem2, "select this item")
end
addEventHandler("onClientMenuSelect", theItem, exampleSelect)
```### onClientMenuExit
Paramters:
* the player who closed the menu
return a Menu element that has been closed is returned```lua
function exampleEscape(theMenu)
print(theMenu, "menu is closed")
end
addEventHandler("onClientMenuSelect", theMenu, exampleEscape)
```