Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_name("Online Role Play Logo")
- script_author("vasyok")
- local inicfg = require 'inicfg'
- local main_ini = inicfg.load({
- settings =
- {
- log = 1,
- }
- }, 'logo')
- tid = {312, 313, 314, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325}
- function main()
- if not isSampfuncsLoaded() or not isSampLoaded() then return end
- while not isSampAvailable() do wait(100) end
- while sampGetCurrentServerName() == "Online RP | (.+)" do wait(0) end
- if not sampGetCurrentServerName():lower():match("online") then
- thisScript():unload()
- return
- else
- sampRegisterChatCommand('logo', set_logo)
- num = main_ini.settings.log
- end
- IsLoaded = loadTextureDictionary('logo'..num)
- if not IsLoaded then sampAddChatMessage("Чёт не так с логотипом у тя", -1) return
- elseif IsLoaded then
- lua_thread.create(function()
- while true do
- wait(1)
- sprite = loadSprite(string.match(sampGetCurrentServerName(), 'Online RP | (.+)'))
- return
- end
- end)
- end
- while true do
- wait(0)
- for key, val in pairs(tid) do sampTextdrawDelete(val) end
- if sprite ~= nil then
- drawSprite(sprite, 589, 20, 57, 57, 255, 255, 255, 255)
- end
- end
- end
- function set_logo(arg)
- if tonumber(arg) >= 1 and tonumber(arg) <= 3 then
- inicfg.save({
- settings = {
- log = arg,
- }
- }, 'logo')
- thisScript():reload()
- else
- sampAddChatMessage('Такого файла не существует!', -1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement