Advertisement
Guest User

Untitled

a guest
Jan 31st, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. script_name("Online Role Play Logo")
  2. script_author("vasyok")
  3.  
  4. local inicfg = require 'inicfg'
  5.  
  6. local main_ini = inicfg.load({
  7. settings =
  8. {
  9. log = 1,
  10. }
  11. }, 'logo')
  12.  
  13. tid = {312, 313, 314, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325}
  14.  
  15. function main()
  16. if not isSampfuncsLoaded() or not isSampLoaded() then return end
  17. while not isSampAvailable() do wait(100) end
  18. while sampGetCurrentServerName() == "Online RP | (.+)" do wait(0) end
  19. if not sampGetCurrentServerName():lower():match("online") then
  20. thisScript():unload()
  21. return
  22. else
  23. sampRegisterChatCommand('logo', set_logo)
  24. num = main_ini.settings.log
  25. end
  26. IsLoaded = loadTextureDictionary('logo'..num)
  27. if not IsLoaded then sampAddChatMessage("Чёт не так с логотипом у тя", -1) return
  28. elseif IsLoaded then
  29. lua_thread.create(function()
  30. while true do
  31. wait(1)
  32. sprite = loadSprite(string.match(sampGetCurrentServerName(), 'Online RP | (.+)'))
  33. return
  34. end
  35. end)
  36. end
  37. while true do
  38. wait(0)
  39. for key, val in pairs(tid) do sampTextdrawDelete(val) end
  40. if sprite ~= nil then
  41. drawSprite(sprite, 589, 20, 57, 57, 255, 255, 255, 255)
  42. end
  43. end
  44. end
  45.  
  46. function set_logo(arg)
  47. if tonumber(arg) >= 1 and tonumber(arg) <= 3 then
  48. inicfg.save({
  49. settings = {
  50. log = arg,
  51. }
  52. }, 'logo')
  53. thisScript():reload()
  54. else
  55. sampAddChatMessage('Такого файла не существует!', -1)
  56. end
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement