Skip to content

FAQ

How to add notepads

Problem:

How to add notepads to the config?

Solution:

In here i want to add a new item and call it my_notepad

Create the item

If you're using qbcore create a new item in here qb-core/shared/items.lua:

lua
["notepad"] = {
    name = "my_notepad",
    label = "New Notepad",
    weight = 250,
    type = "item",
    image = "my_notepad.png",
    unique = true,
    useable = true,
    shouldClose = true,
    combinable = nil,
    description = "description"
}

And if you're using ox_invnetory add the item in ox_inventory/data/items.lua and use this format:

lua
["notepad"] = {
    label = "my_notepad",
    weight = 1,
    stack = false,
    close = true,
    description = "description"
}
Add the new item in keep-notes's config
  1. Add Item Directly Inside Config.items Table:

    • Add the new item (notepad) to the existing Config.items.
    • Example:
    lua
    Config.items = {
        --- existing config 
    
        myNotepad = {
            notepad = true,
            item_name = 'my_notepad',
            maxPaper = 50,
            theme = 'vintage',
            wishlist = {
                {
                    label = 'Gold Watch',
                    value = 'gold_watch',
                },
                {
                    label = 'Diamond Ring',
                    value = 'diamond_ring',
                }
            }
        }
    }
  2. Add Item Outside of the Config.items Table:

    • Add the new item (notepad) to Config.items after the table has been defined.
    • Example:
    lua
    Config.items = { ... }
    
    Config.items.myNotepad = {
        notepad = true,
        item_name = 'my_notepad',
        maxPaper = 50,
        theme = 'vintage',
        wishlist = {
            {
                label = 'Gold Watch',
                value = 'gold_watch',
            },
            {
                label = 'Diamond Ring',
                value = 'diamond_ring',
            }
        }
    }

How to edit user emote with other emote scripts

How to edit the emote event for the keep-notes so it'll works with a different emote scripts rather than just dpemotes.

Problem

Script doesn't show any emotes/animations while writing or looking at a note/notepad

Solution

You can make a client-side event (in my script keep-notes) for your emote script and trigger emotes by using the same events as dpemotes.

Find the required exports/events

Find out how your emote script works and what events or exports it uses to start and end emotes.

For example, r_animations uses these exports:

lua
-- start an emote
exports['r_animations']:StartAnimationPlay(emote)
-- end an emote
exports['r_animations']:StopAnimation()
Create the trigger event

Open the /config.lua (keep-notes/config.lua) file and add this new event to the end of it:

lua
AddEventHandler('animations:client:EmoteCommandStart', function(emote)
    if #emote <= 0 then return end
    local name = string.lower(emote[1])
    if name == 'c' then
        exports['r_animations']:StopAnimation()
        return
    end
    exports['r_animations']:StartAnimationPlay(name)
end)
Replace the exports

Now that we know exports['r_animations']:StartAnimationPlay starts the animation, and exports['r_animations']:StopAnimation stops it, we can replace those exports, and we should be good to go.

Save

Save the file and restart the script.