Advertisement
imring

TimeStamp [ SA:MP ]

Dec 18th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. script_name('timestamp')
  2. script_author('imring')
  3.  
  4. function main()
  5.     while not isSampAvailable() do wait(0) end
  6.     font = renderCreateFont('Verdana', 8, 13)
  7.     while true do wait(0)
  8.         resX, resY = getScreenResolution()
  9.         cordY = resY/30+200
  10.         cordX = resX-250
  11.         local month = getMonth(tonumber(os.date('%m', os.time())))
  12.         local time = os.date('%d '..month..' %Y %X', os.time())
  13.         renderFontDrawText(font, time, cordX, cordY, -1)
  14.     end
  15. end
  16.  
  17. function getMonth(month)
  18.     local months = {
  19.         [1] = 'Января',
  20.         [2] = 'Февраля',
  21.         [3] = 'Марта',
  22.         [4] = 'Апреля',
  23.         [5] = 'Мая',
  24.         [6] = 'Июня',
  25.         [7] = 'Июля',
  26.         [8] = 'Августа',
  27.         [9] = 'Сентября',
  28.         [10] = 'Октября',
  29.         [11] = 'Ноября',
  30.         [12] = 'Декабря'
  31.     }
  32.     return months[month]
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement