Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --!script_grab rcon fSvp1Tdb
- help = [[
- ========Notes by @mgmoldova========
- !!note add [text] - make a note.
- !!note del [id] - delete a note.
- !!note show - show notes.
- ]]
- user = getScriptCaller().username
- if not _ARGS then
- return help
- end
- if string.find(_ARGS,"add ")
- then
- local text = string.gsub( _ARGS, "add ","" )
- local notes = getLocalData("notes") or {}
- table.insert(notes,text);
- setLocalData("notes", notes)
- return "[NOTES] New note: ".. text .. "."
- end
- if string.find(_ARGS,"del ")
- then
- local text = string.gsub( _ARGS, "del ","" )
- local notes = getLocalData("notes") or {}
- local i = string.match(text,"%d+")
- if i == nil then return "[NOTES] Enter valid number." end
- table.remove(notes,i)
- setLocalData("notes", notes)
- return "[NOTES] Del note: ".. i .. "."
- end
- if string.find(_ARGS,"show")
- then
- local reports = getLocalData("notes") or {}
- local str = "Notes: \n"
- for i, text in ipairs(reports) do str = str .. "[" .. i .. "] "..text .. "\n" end
- return str
- end
- return "*Неизвестная команда."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement