Advertisement
imring

ChatLogger [ SA:MP ]

Dec 16th, 2017
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. script_author('imring')
  2. script_name('chatlogger')
  3.  
  4. function main()
  5.     while not isSampAvailable() do wait(0) end
  6.     if not doesDirectoryExist('moonloader\\logs') then createDirectory('moonloader\\logs') end
  7.     name = os.date("%d.%m %H %M")..".log"
  8.     while true do
  9.         wait(0)
  10.         if text ~= sampGetChatString(99) then
  11.             text = sampGetChatString(99)
  12.             local f = io.open('moonloader/logs/'.. name, 'a')
  13.             f:write('\n['..os.date("%H:%M:%S")..'] '..text)
  14.             f:close()
  15.         end
  16.     end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement