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
If you're using qbcore create a new item in here qb-core/shared/items.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:
["notepad"] = {
label = "my_notepad",
weight = 1,
stack = false,
close = true,
description = "description"
}
Add Item Directly Inside
Config.items
Table:- Add the new item (notepad) to the existing
Config.items
. - Example:
luaConfig.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', } } } }
- Add the new item (notepad) to the existing
Add Item Outside of the
Config.items
Table:- Add the new item (notepad) to
Config.items
after the table has been defined. - Example:
luaConfig.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', } } }
- Add the new item (notepad) to
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 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:
-- start an emote
exports['r_animations']:StartAnimationPlay(emote)
-- end an emote
exports['r_animations']:StopAnimation()
Open the /config.lua
(keep-notes/config.lua) file and add this new event to the end of it:
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)
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 the file and restart the script.