Advertisement
ACheats

NOTES

Dec 15th, 2018
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. --!script_grab rcon fSvp1Tdb
  2. help = [[
  3. ========Notes by @mgmoldova========
  4. !!note add [text] - make a note.
  5. !!note del [id] - delete a note.
  6. !!note show - show notes.
  7. ]]
  8. user = getScriptCaller().username
  9. if not _ARGS then
  10.     return help
  11. end
  12.  
  13. if string.find(_ARGS,"add ")
  14. then
  15.   local text = string.gsub( _ARGS, "add ","" )
  16.   local notes = getLocalData("notes") or {}
  17.   table.insert(notes,text);
  18.   setLocalData("notes", notes)
  19.   return "[NOTES] New note: ".. text .. "."
  20. end
  21.  
  22.  
  23. if string.find(_ARGS,"del ")
  24. then
  25.   local text = string.gsub( _ARGS, "del ","" )
  26.   local notes = getLocalData("notes") or {}
  27.   local i = string.match(text,"%d+")
  28.   if i == nil then return "[NOTES] Enter valid number." end
  29.   table.remove(notes,i)  
  30.   setLocalData("notes", notes)
  31.   return "[NOTES] Del note: ".. i .. "."
  32. end
  33.  
  34.  
  35. if string.find(_ARGS,"show")
  36. then
  37.   local reports = getLocalData("notes") or {}
  38.   local str = "Notes: \n"
  39.   for i, text in ipairs(reports) do str = str .. "[" .. i .. "] "..text .. "\n" end
  40.   return str
  41. end
  42.  
  43.  
  44. return "*Неизвестная команда."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement