Advertisement
Guest User

Squares.lua

a guest
Jan 22nd, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. script_name("Squares Map By Kotik Wilson")
  2. script_version("1.1")
  3. script_author("Kotik_prikol and Laine_prikol")
  4.  
  5. require"lib.moonloader"
  6.  
  7. function Territory()
  8.     local Square = { 'А', 'Б', 'В', 'Г', 'Д', 'Ж', 'З', 'И', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Я' }
  9.     local X, Y, Z = getCharCoordinates(playerPed)
  10.     X = math.ceil((X + 3000) / 250)
  11.     Y = math.ceil((Y * - 1 + 3000) / 250)
  12.     Y = Square[Y]
  13.     local Squares = (Y.."-"..X)
  14.     return Squares
  15. end
  16.  
  17. function main()
  18.     if not isSampfuncsLoaded() or not isSampLoaded() then return end
  19.     while not isSampAvailable() do wait(100) end
  20.     sampAddChatMessage("Squares Map: Попытка загрузить файл конфигурации...", 0xCCFFDD56)
  21.     local file = io.open("moonloader/Squares_Map.cfg", "r")
  22.     if file == nil then
  23.         sampAddChatMessage("Squares Map: Фатальная ошибка: Не удолось загрузить файл конфигурации!!!", 0xCCFFDD56)
  24.     else
  25.         message = file:read("*a")
  26.         sampAddChatMessage("Squares Map: Файл конфигурации загружен!", 0xCCFFDD56)
  27.         sampAddChatMessage("Squares Map v.1.1 By Kotik Wilson and Laine_prikol", 0xCCFFDD56)
  28.     end
  29.     while true do
  30.         wait(0)
  31.         if isKeyDown(219) then
  32.             sampSendChat("/f "..message..", я в квадрате: "..Territory())
  33.             while isKeyDown(219) do wait(100) end
  34.         end
  35.     end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement