Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_name('packScripts')
- script_author('imring')
- script_version('1.00')
- timestamp = true
- textdraw = false
- colorText = 0xCCFF00
- colorTextString = '{'..string.format('%x', colorText)..'}'
- function main()
- while not isSampAvailable() do wait(0) end
- font1 = renderCreateFont('Verdana', 8, 13)
- resX, resY = getScreenResolution()
- while update ~= false do wait(100) end
- sampRegisterChatCommand('tstamp', timeStamp)
- sampRegisterChatCommand('rtd', renderTextDraw)
- sampRegisterChatCommand('id', idPlayer)
- sampAddChatMessage('Скрипт '..thisScript().name..' загружён. Версия: '..thisScript().version..'.', colorText)
- while true do wait(0)
- if not sampIsScoreboardOpen() then
- if timestamp then
- local cordY = resY/30+200
- local cordX = resX-250
- local month = getMonth(tonumber(os.date('%m', os.time())))
- local time = os.date('%d '..month..' %Y %X', os.time())
- renderFontDrawText(font1, time, cordX, cordY, -1)
- end
- if textdraw then
- for textdrawid = 0, 3000 do
- if sampTextdrawIsExists(textdrawid) then
- local X, Y = sampTextdrawGetPos(textdrawid)
- local posX, posY = convertGameScreenCoordsToWindowScreenCoords(X, Y)
- renderFontDrawText(font1, textdrawid, posX, posY, 0xFF00FF00)
- end
- end
- end
- end
- if isKeyJustPressed(84) and not sampIsChatInputActive() and not sampIsDialogActive() then
- sampSetChatInputEnabled(true)
- end
- end
- end
- function timeStamp() timestamp = not timestamp end
- function renderTextDraw() textdraw = not textdraw end
- function idPlayer(text)
- local stringtext = string.match(text, '%q*(.+)')
- if stringtext ~= nil then
- local idplayer = tonumber(stringtext)
- if idplayer == nil then
- for i = 0, 1000 do
- local _, myid = sampGetPlayerIdByCharHandle(playerPed)
- if sampIsPlayerConnected(i) or i == myid then
- local nick = sampGetPlayerNickname(i)
- if string.find(string.lower(nick), string.lower(stringtext)) then
- local ping = sampGetPlayerPing(i)
- local color = string.sub(string.format('%x', sampGetPlayerColor(i)), 3)
- sampAddChatMessage('Nick: {'..color..'}'..nick..' {FFFFFF}| ID: '..i..' | Ping: '..ping, -1)
- end
- end
- end
- else
- for i = 0, 1000 do
- local _, myid = sampGetPlayerIdByCharHandle(playerPed)
- if idplayer == i then
- if sampIsPlayerConnected(i) or i == myid then
- local nick = sampGetPlayerNickname(i)
- local ping = sampGetPlayerPing(i)
- local color = string.sub(string.format('%x', sampGetPlayerColor(i)), 3)
- sampAddChatMessage('Nick: {'..color..'}'..nick..' {FFFFFF}| ID: '..i..' | Ping: '..ping, -1)
- end
- end
- end
- end
- else sampAddChatMessage('Use: [ /id [ID/NICK] ]', -1) end
- end
- function getMonth(month)
- local months = {
- [1] = 'Января',
- [2] = 'Февраля',
- [3] = 'Марта',
- [4] = 'Апреля',
- [5] = 'Мая',
- [6] = 'Июня',
- [7] = 'Июля',
- [8] = 'Августа',
- [9] = 'Сентября',
- [10] = 'Октября',
- [11] = 'Ноября',
- [12] = 'Декабря'
- }
- return months[month]
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement