Client exports
Notebook
Client exports that open and close the notebook, open a built-in app and read the notebook's state.
These exports run on the player's own client and act on that player's notebook.
#Open
Opens the notebook. The server checks the player first (character loaded, notebook item when Config.Access.RequireItem is on), so the book appears a moment later.
lua---@return boolean started true when the open request was sent
exports['fx-pocketbook']:Open()
luaexports['fx-pocketbook']:Open()
- Returns
falsewhen the interface has not loaded yet, the notebook is already open or opening, or the player is placing a relay pole or phonograph or charging a back radio battery (fx-radio). truemeans the request was sent. If the server refuses (no item, character not loaded), the book stays closed and the player sees the reason as a notification.
#Close
Closes the notebook and gives the mouse and keyboard back to the game.
luaexports['fx-pocketbook']:Close()
luaexports['fx-pocketbook']:Close()
- Returns nothing.
- The book also closes by itself when the player switches character.
#IsOpen
Returns whether the notebook is open.
lua---@return boolean open
exports['fx-pocketbook']:IsOpen()
luaif exports['fx-pocketbook']:IsOpen() then return end
#OpenApplication
Opens the notebook on a built-in app. If the book is already open it switches to that app.
lua---@param id string built-in app id
---@param intent? table only for 'telegram': { view = 'papers' } or { view = 'compose' }
---@return boolean ok
exports['fx-pocketbook']:OpenApplication(id, intent)
luaexports['fx-pocketbook']:OpenApplication('telegram', { view = 'compose' })
| Parameter | What it does |
|---|---|
id |
One of pusula, kartmasasi, hekim, cagri, pano, saat, almanak, telegram, contacts, news, darkchat, company, billing, music, atlas, album, notes, settings, bank, stables, faq, store, calculator, kartlarim, takvim, eskiz, borsa, mdt, katalog |
intent |
Used only with telegram. view = 'papers' opens the papers page, view = 'compose' opens a new telegram. Any other value is dropped. |
- Returns
falsefor an unknown id, or when the book cannot open (same conditions asOpen). - For your own app use [
OpenApp](/phone/docs/pocketbook/exports/client/custom-apps).
#IsPlacingRelay
Returns whether the player is in placement mode right now.
lua---@return boolean placing
exports['fx-pocketbook']:IsPlacingRelay()
luaif exports['fx-pocketbook']:IsPlacingRelay() then return end
- Placement mode is used for both the relay pole (
pocketbook_relay) and the phonograph (pocketbook_phonograph), so this is alsotruewhile a phonograph is being placed. - The notebook cannot open while placement mode is active.