Как исправить? "unexpected symbol near ')'"

mentaletion

Новичок
Автор темы
11
0
Версия MoonLoader
.026-beta
Привет, скачивал скрипт на лого а он даже не запускается выдавая 2 строки в консоль
[ML] (error) logo.lua: C:\GTA\moonloader\logo.lua:357: unexpected symbol near ')'
[ML] (error) logo.lua: Script died due to an error. (15E6BC14)


Код:
local q = require 'lib.samp.events'
script_name("NewLogo by Clyde Mods")
script_description('https://www.blast.hk/members/437308/')
local inicfg = require 'inicfg'
local logo = 1
local act = false
if not doesDirectoryExist("moonloader/config") then
    os.execute('md "'..getWorkingDirectory()..'/config"') 
    local f = io.open("moonloader/config", "w")
end
if not doesFileExist("moonloader/config/" .. thisScript().name .. ".ini") then
    local f = io.open("moonloader/config/" .. thisScript().name .. ".ini", "w")
    if f then
        f:write('\nphoenix = 1 \ntucson = 1 \nscottdale = 1 \nchandler = 1\nbrainburg = 1\nsaintrose = 1\nmesa = 1\nredrock = 1\nyuma = 1\nsurprise = 1\nprescott = 1\nglendale = 1\nkingman = 1\nwinslow = 1\npayson = 1\ngilbert = 1\nshowlow = 1\ncasagrande = 1\npage = 1\nsuncity = 1\nqueencreek = 1\nsedona = 1')
        f:close()
    end
    
end

local phoenix       = 1
local tucson       = 1
local scottdale       = 1
local chandler       = 1
local brainburg       = 1
local saintrose       = 1
local mesa       = 1
local redrock       = 1
local yuma       = 1
local surprise       = 1
local prescott       = 1
local glendale       = 1
local kingman       = 1
local winslow = 1
local payson = 1
local gilbert      = 1
local showlow      = 1
local casagrande      = 1
local page      = 1
local suncity      = 1
local queencreek      = 1
local sedona      = 1

mainIni = inicfg.load(nil,  "moonloader/config/" .. thisScript().name .. ".ini")
emerald     = mainIni.main.emerald
trilliant    = mainIni.main.gretrilliant
crystal     =  mainIni.main.crystal
sapphire     =  mainIni.main.sapphire
amber   = mainIni.main.amber
ruby    = mainIni.main.ruby
gold    = mainIni.main.gold
phoenix         = mainIni.main.phoenix   
tucson          = mainIni.main.tucson   
scottdale       = mainIni.main.scottdale
chandler        = mainIni.main.chandler 
brainburg       = mainIni.main.brainburg
saintrose       = mainIni.main.saintrose
mesa            = mainIni.main.mesa     
redrock         = mainIni.main.redrock   
yuma            = mainIni.main.yuma     
surprise        = mainIni.main.surprise 
prescott        = mainIni.main.prescott 
glendale        = mainIni.main.glendale 
kingman         = mainIni.main.kingman
winslow = mainIni.main.winslow
payson = mainIni.main.payson
gilbert         = mainIni.main.gilbert
showlow         = mainIni.main.showlow
casagrande      = mainIni.main.casagrande
page            = mainIni.main.page
suncity         = mainIni.main.suncity
queencreek      = mainIni.main.queencreek
sedona          = mainIni.main.sedona
srp02       = mainIni.main.srp02
revolution  = mainIni.main.revolution
classic     = mainIni.main.classic
legacy      = mainIni.main.legacy
blue = mainIni.main.blue
green = mainIni.main.green
red =  mainIni.main.red
lime =  mainIni.main.lime
evolve01 = mainIni.main.evolve01
evolve02 = mainIni.main.evolve02
evolve03 = mainIni.main.evolve03
blue = mainIni.main.blue
green = mainIni.main.green
red =  mainIni.main.red
lime =  mainIni.main.lime
evolve01 = mainIni.main.evolve01
evolve02 = mainIni.main.evolve02
evolve03 = mainIni.main.evolve03

if emerald == nil then emerald = 1 end
if trilliant == nil then trilliant = 1 end
if crystal == nil then crystal = 1 end
if sapphire == nil then sapphire = 1 end
if amber == nil then amber = 1 end
if ruby == nil then ruby = 1 end
if gold == nil then gold = 1 end
if  phoenix   == nil then phoenix = 1 end
if  tucson   == nil then tucson = 1 end
if  scottdale   == nil then scottdale = 1 end
if  chandler   == nil then chandler = 1 end
if  brainburg   == nil then brainburg = 1 end
if  saintrose   == nil then saintrose = 1 end
if  mesa   == nil then mesa = 1 end
if  redrock   == nil then redrock = 1 end
if  yuma   == nil then yuma = 1 end
if  surprise   == nil then surprise = 1 end
if  prescott   == nil then prescott = 1 end
if  glendale   == nil then glendale = 1 end
if  kingman   == nil then kingman = 1 end
if  winslow   == nil then winslow = 1 end
if  payson   == nil then payson = 1 end
if  gilbert   == nil then gilbert = 1 end
if  showlow   == nil then showlow = 1 end
if  casagrande   == nil then casagrande = 1 end
if  page   == nil then page = 1 end
if  suncity   == nil then suncity = 1 end
if  queencreek   == nil then queencreek = 1 end
if  sedona   == nil then sedona = 1 end
if srp02 == nil then srp02 = 1 end
if revolution == nil then revolution = 1 end
if classic == nil then classic = 1 end
if legacy == nil then legacy = 1 end
if blue == nil then blue = 1 end
if green == nil then green = 1 end
if red == nil then red = 1 end
if lime == nil then lime = 1 end
if evolve01 == nil then evolve01 = 1 end
if evolve02 == nil then evolve02 = 1 end
if evolve03 == nil then evolve03 = 1 end

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('logoreload',function() lua_thread.create(function() s = thisScript() s:reload() end)  end)
    sampAddChatMessage('Logo by MaGnAt',-1)
    sampRegisterChatCommand('logo',function(param)
                                            if onServer == 'diamond' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if diamondServ == 'emerald' then emerald = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'trilliant' then trilliant = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'crystal' then crystal = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'sapphire' then sapphire = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'amber' then amber = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'ruby' then ruby = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'gold' then gold = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end

                                                end
                                            end
                                            if onServer == 'arizona' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if arizonaServ == 'phoenix' then phoenix = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'tucson' then tucson = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'scottdale' then scottdale = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'chandler' then chandler = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'brainburg' then brainburg = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'saint rose' then saintrose = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'mesa' then mesa = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'red rock' then redrock = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'yuma' then yuma = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'surprise' then surprise = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'prescott' then prescott = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'glendale' then glendale = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'kingman' then kingman = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'winslow' then winslow = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'payson' then payson = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    if arizonaServ == 'gilbert' then gilbert = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'show low' then showlow = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'casa grande' then casagrande = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'page' then page = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'sun city' then suncity = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'queen creek' then queencreek = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'sedona' then sedona = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))   
                                                    end
                                                end
                                            end
                                            if onServer == 'samprp' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if samprpServ == 'srp02' then srp02 = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if samprpServ == 'revolution' then revolution = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if samprpServ == 'classic' then classic = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if samprpServ == 'legacy' then legacy = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                end
                                            end
                                            if onServer == 'advance' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if advanceServer == 'blue' then blue = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(blue), -1)
                                                        sprite = loadSprite(blue)
                                                    end
                                                    if advanceServer == 'red' then red = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(red), -1)
                                                        sprite = loadSprite(red)
                                                    end
                                                    if advanceServer == 'green' then green = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(green), -1)
                                                        sprite = loadSprite(green)
                                                    end
                                                    if advanceServer == 'lime' then lime = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(lime), -1)
                                                        sprite = loadSprite(lime)
                                                    end
                                                end
                                            end
                                            if onServer == 'evolve' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if servevolve == 'ev01' then evolve01 = tonumber(param)
                                                        
                                                        writeServ()
                                                        sprite = loadSprite(evolve01)
                                                    end
                                                    if servevolve == 'ev02' then evolve02 = tonumber(param)
                                                        writeServ()
                                                        sprite = loadSprite(evolve02)
                                                    end
                                                    if servevolve == 'ev03' then evolve03 = tonumber(param)
                                                        writeServ()
                                                        sprite = loadSprite(evolve03)
                                                    end
                                                end
                                            end
                                    end)
                                    --sampRegisterChatCommand('tdr',function(param) print(sampTextdrawGetPos(param)) end)

        lua_thread.create(function()
            while sampGetCurrentServerName() == "SA-MP" do wait(0) end
            wait(500)

                if sampGetCurrentServerName():match("Diamond") then
                    onServer = 'diamond'       
                    act = true
                elseif sampGetCurrentServerName():match("Arizona") then
                    onServer = 'arizona'       
                    act = true
                elseif sampGetCurrentServerName():match("Samp.+Rp") then
                    onServer = 'samprp'
                    sampTextdrawDelete(0)
                    act = true
                elseif sampGetCurrentServerName():match("Advance") then
                    onServer = 'advance'
                    print('advance server')
                    act = true
                elseif sampGetCurrentServerName():match("Evolve") then
                    onServer = 'evolve'
                    print('evolve server')
                    act = true
                end
                wait(1000)
 
                if onServer == 'diamond' then
                    servername = sampGetCurrentServerName()
                    if servername:find('Emerald') then
                        diamondServ = 'emerald'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(emerald)
                    elseif servername:find('Trilliant') then
                        diamondServ = 'trilliant'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(trilliant)
                    elseif servername:find('Crystal') then
                        diamondServ = 'crystal'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(crystal)
                    elseif servername:find('Sapphire') then
                        diamondServ = 'sapphire'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(sapphire)
                    elseif servername:find('Amber') then
                        diamondServ = 'amber'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(amber)
                    elseif servername:find('Ruby') then
                        diamondServ = 'ruby'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(ruby)
                    elseif servername:find('Gold') then
                        diamondServ = 'gold'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(gold)
                    end
                    --for i = 177, 188 do
                        --sampTextdrawDelete(i)
                    --end
                end
                if onServer == 'arizona' then
                    servername = sampGetCurrentServerName()
                    if servername:find('Phoenix') then
                        arizonaServ = 'phoenix'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(phoenix)
                    elseif servername:find('Tucson') then
                        arizonaServ = 'tucson'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(tucson)
                    elseif servername:find('Scottdale') then
                        arizonaServ = 'scottdale'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(scottdale)
                    elseif servername:find('Chandler') then
                        arizonaServ = 'chandler'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(chandler)
                    elseif servername:find('Brainburg') then
                        arizonaServ = 'brainburg'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(brainburg)
                    elseif servername:find('SaintRose') then
                        arizonaServ = 'saint rose'
                        IsLoaded = loadTextureDictionary('saintrose')
                        sprite = loadSprite(saintrose)
                    elseif servername:find('Mesa') then
                        arizonaServ = 'mesa'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(mesa)
                    elseif servername:find('Red.Rock') then
                        arizonaServ = 'red rock'
                        IsLoaded = loadTextureDictionary('redrock')
                        sprite = loadSprite(redrock)
                    elseif servername:find('Yuma') then
                        arizonaServ = 'yuma'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(yuma)
                    elseif servername:find('Surprise') then
                        arizonaServ = 'surprise'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(surprise)
                    elseif servername:find('Prescott') then
                        arizonaServ = 'prescott'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(prescott)
                    elseif servername:find('Glendale') then
                        arizonaServ = 'glendale'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(glendale)
                    elseif servername:find('Kingman') then
                        arizonaServ = 'kingman'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(kingman)
                    elseif servername:find('Winslow') then
                        arizonaServ = 'winslow'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(winslow)
                    elseif servername:find('Payson') then
                        arizonaServ = 'payson'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(payson)
                    elseif servername:find('Gilbert') then
                        arizonaServ = 'gilbert'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(gilbert)
                    elseif servername:find('Show.Low') then
                        arizonaServ = 'show low'
                        IsLoaded = loadTextureDictionary('showlow')
                        sprite = loadSprite(showlow)
                    elseif servername:find('Casa.Grande') then
                        arizonaServ = 'casa grande'
                        IsLoaded = loadTextureDictionary('casagrande')
                        sprite = loadSprite(casagrande)
                    elseif servername:find('Page') then
                        arizonaServ = 'page'
                        IsLoaded = loadTextureDictionary('page')
                        sprite = loadSprite(page)
                    elseif servername:find('Sun.City') then
                        arizonaServ = 'sun city'
                        IsLoaded = loadTextureDictionary('suncity')
                        sprite = loadSprite(suncity)
                    elseif servername:find('Queen.Creek') then
                        arizonaServ = 'queen creek'
                        IsLoaded = loadTextureDictionary('queencreek')
                        sprite = loadSprite(queencreek)
                    elseif servername:find('Sedona') then
                        arizonaServ = 'sedona'
                        IsLoaded = loadTextureDictionary('sedona')
                        sprite = loadSprite(sedona)                       
                    end

                end
                if onServer == 'samprp' then
                    servername = sampGetCurrentServerName()
                    if servername:find('02') then
                        samprpServ = 'srp02'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(srp02)
                    elseif servername:find('Revolution') then
                        samprpServ = 'revolution'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(revolution)
                    elseif servername:find('Classic') then
                        samprpServ = 'classic'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(classic)
                    elseif servername:find('Legacy') then
                        samprpServ = 'legacy'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(legacy)
                    end
                end
                if onServer == 'advance' then
                    
                    servername = sampGetCurrentServerName()
                    --sampAddChatMessage(tostring(servername), -1)
                    if servername:find('Advance RolePlay (.+)') then
                        advanceNum = servername:match('Advance RolePlay (.+)')
                        --sampAddChatMessage(tostring(advanceNum), -1)
                        if advanceNum:find('Blue') then
                            advanceServer = 'blue'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(blue)
                        elseif advanceNum:find('Green') then
                            advanceServer = 'green'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(green)
                        elseif advanceNum:find('Red') then
                            advanceServer = 'red'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(red)
                        elseif advanceNum:find('Lime') then
                            advanceServer = 'lime'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(lime)
                        end
                        for i = 125, 138 do
                            sampTextdrawDelete(i)
                        end
                    end
                end
                if onServer == 'evolve' then
                    servername = sampGetCurrentServerName()
                    if servername:find('Server: 01') then print('evolve 01') servevolve = 'ev01' IsLoaded = loadTextureDictionary(servevolve) sprite = loadSprite(evolve01)
                    elseif servername:find('Server: 02') then print('evolve 02') servevolve = 'ev02' IsLoaded = loadTextureDictionary(servevolve) sprite = loadSprite(evolve02)
                    elseif servername:find('Server: 03') then print('evolve 03') servevolve = 'ev03' IsLoaded = loadTextureDictionary(servevolve) sprite = loadSprite(evolve03) end
                    for i = 379, 392 do
                        sampTextdrawDelete(i)
                    end           
                end
        end)
--[[[ML] (script) Logo by MaGnAt : 563   14
[ML] (script) Logo by MaGnAt : 565   6
[ML] (script) Logo by MaGnAt : 550   1]]
    lua_thread.create(function()
        while true do
            wait(1)
            
            if sprite ~= nil and act then
                drawSprite(sprite, 589, 20, 76, 38, 255, 255, 255, 255)
            end
        end
    end)
end

function q.onShowTextDraw(id, data)
    --print(data.position.x,data.position.y,id)
    if data.position.x  > 530 and data.position.y < 26 then
        return false
    end
    if sampGetCurrentServerName():match("Diamond") then
        onServer = 'diamond'
    elseif sampGetCurrentServerName():match("Arizona") then
        onServer = 'arizona'
        if data.position.y >= 1 and data.position.y < 50 and data.position.x < 603 and data.position.x > 500 then 
            return false
        end
    elseif sampGetCurrentServerName():match("Samp.+Rp") and id == 0 then
        onServer = 'samprp'
        return false
    elseif sampGetCurrentServerName():match("Advance") then
        onServer = 'advance'
        print('advance server')
        act = true
        for i = 9, 22 do
            sampTextdrawDelete(i)
        end
    elseif sampGetCurrentServerName():match("Evolve") then
        onServer = 'evolve'
        print('evolve server')
        act = true
    end
end

function writeServ()
    result = inicfg.save({main = {
        emerald   = emerald,
        trilliant = trilliant,
        crystal  = crystal, 
        sapphire = sapphire,
        amber = amber,
        ruby = ruby,
        gold  = gold,
        phoenix         = phoenix,     
        tucson          = tucson,       
        scottdale       = scottdale,       
        chandler        = chandler,     
        brainburg       = brainburg,       
        saintrose       = saintrose,       
        mesa            = mesa,           
        redrock         = redrock,         
        yuma            = yuma,           
        surprise        = surprise,       
        prescott        = prescott,       
        glendale        = glendale,       
        kingman         = kingman,   
        winslow = winslow,
        payson = payson,
        gilbert         = gilbert,
        showlow         = showlow,
        casagrande      = casagrande,
        page            = page,
        suncity         = suncity,
        queencreek      = queencreek,
        sedona          = sedona,
        srp02       = srp02,   
        revolution  = revolutio,
        classic     = classic, 
        legacy      = legacy,
        blue = blue,
        green = green,
        red = red,
        lime = lime,
        evolve01 = evolve01,
        evolve02 = evolve02,
        evolve03 = evolve03              }},"moonloader/config/" .. thisScript().name .. ".ini")
end
 
  • Bug
Реакции: Corenale
Решение
255 строка, вы пропустили end
Lua:
local q = require 'lib.samp.events'
script_name("NewLogo by Clyde Mods")
script_description('https://www.blast.hk/members/437308/')
local inicfg = require 'inicfg'
local logo = 1
local act = false
if not doesDirectoryExist("moonloader/config") then
    os.execute('md "'..getWorkingDirectory()..'/config"')
    local f = io.open("moonloader/config", "w")
end
if not doesFileExist("moonloader/config/" .. thisScript().name .. ".ini") then
    local f = io.open("moonloader/config/" .. thisScript().name .. ".ini", "w")
    if f then
        f:write('\nphoenix = 1 \ntucson = 1 \nscottdale = 1 \nchandler = 1\nbrainburg = 1\nsaintrose = 1\nmesa = 1\nredrock = 1\nyuma = 1\nsurprise = 1\nprescott = 1\nglendale =...

XONE

Участник
7
6
255 строка, вы пропустили end
Lua:
local q = require 'lib.samp.events'
script_name("NewLogo by Clyde Mods")
script_description('https://www.blast.hk/members/437308/')
local inicfg = require 'inicfg'
local logo = 1
local act = false
if not doesDirectoryExist("moonloader/config") then
    os.execute('md "'..getWorkingDirectory()..'/config"')
    local f = io.open("moonloader/config", "w")
end
if not doesFileExist("moonloader/config/" .. thisScript().name .. ".ini") then
    local f = io.open("moonloader/config/" .. thisScript().name .. ".ini", "w")
    if f then
        f:write('\nphoenix = 1 \ntucson = 1 \nscottdale = 1 \nchandler = 1\nbrainburg = 1\nsaintrose = 1\nmesa = 1\nredrock = 1\nyuma = 1\nsurprise = 1\nprescott = 1\nglendale = 1\nkingman = 1\nwinslow = 1\npayson = 1\ngilbert = 1\nshowlow = 1\ncasagrande = 1\npage = 1\nsuncity = 1\nqueencreek = 1\nsedona = 1')
        f:close()
    end
   
end

local phoenix       = 1
local tucson       = 1
local scottdale       = 1
local chandler       = 1
local brainburg       = 1
local saintrose       = 1
local mesa       = 1
local redrock       = 1
local yuma       = 1
local surprise       = 1
local prescott       = 1
local glendale       = 1
local kingman       = 1
local winslow = 1
local payson = 1
local gilbert      = 1
local showlow      = 1
local casagrande      = 1
local page      = 1
local suncity      = 1
local queencreek      = 1
local sedona      = 1

mainIni = inicfg.load(nil,  "moonloader/config/" .. thisScript().name .. ".ini")
emerald     = mainIni.main.emerald
trilliant    = mainIni.main.gretrilliant
crystal     =  mainIni.main.crystal
sapphire     =  mainIni.main.sapphire
amber   = mainIni.main.amber
ruby    = mainIni.main.ruby
gold    = mainIni.main.gold
phoenix         = mainIni.main.phoenix  
tucson          = mainIni.main.tucson  
scottdale       = mainIni.main.scottdale
chandler        = mainIni.main.chandler
brainburg       = mainIni.main.brainburg
saintrose       = mainIni.main.saintrose
mesa            = mainIni.main.mesa    
redrock         = mainIni.main.redrock  
yuma            = mainIni.main.yuma    
surprise        = mainIni.main.surprise
prescott        = mainIni.main.prescott
glendale        = mainIni.main.glendale
kingman         = mainIni.main.kingman
winslow = mainIni.main.winslow
payson = mainIni.main.payson
gilbert         = mainIni.main.gilbert
showlow         = mainIni.main.showlow
casagrande      = mainIni.main.casagrande
page            = mainIni.main.page
suncity         = mainIni.main.suncity
queencreek      = mainIni.main.queencreek
sedona          = mainIni.main.sedona
srp02       = mainIni.main.srp02
revolution  = mainIni.main.revolution
classic     = mainIni.main.classic
legacy      = mainIni.main.legacy
blue = mainIni.main.blue
green = mainIni.main.green
red =  mainIni.main.red
lime =  mainIni.main.lime
evolve01 = mainIni.main.evolve01
evolve02 = mainIni.main.evolve02
evolve03 = mainIni.main.evolve03
blue = mainIni.main.blue
green = mainIni.main.green
red =  mainIni.main.red
lime =  mainIni.main.lime
evolve01 = mainIni.main.evolve01
evolve02 = mainIni.main.evolve02
evolve03 = mainIni.main.evolve03

if emerald == nil then emerald = 1 end
if trilliant == nil then trilliant = 1 end
if crystal == nil then crystal = 1 end
if sapphire == nil then sapphire = 1 end
if amber == nil then amber = 1 end
if ruby == nil then ruby = 1 end
if gold == nil then gold = 1 end
if  phoenix   == nil then phoenix = 1 end
if  tucson   == nil then tucson = 1 end
if  scottdale   == nil then scottdale = 1 end
if  chandler   == nil then chandler = 1 end
if  brainburg   == nil then brainburg = 1 end
if  saintrose   == nil then saintrose = 1 end
if  mesa   == nil then mesa = 1 end
if  redrock   == nil then redrock = 1 end
if  yuma   == nil then yuma = 1 end
if  surprise   == nil then surprise = 1 end
if  prescott   == nil then prescott = 1 end
if  glendale   == nil then glendale = 1 end
if  kingman   == nil then kingman = 1 end
if  winslow   == nil then winslow = 1 end
if  payson   == nil then payson = 1 end
if  gilbert   == nil then gilbert = 1 end
if  showlow   == nil then showlow = 1 end
if  casagrande   == nil then casagrande = 1 end
if  page   == nil then page = 1 end
if  suncity   == nil then suncity = 1 end
if  queencreek   == nil then queencreek = 1 end
if  sedona   == nil then sedona = 1 end
if srp02 == nil then srp02 = 1 end
if revolution == nil then revolution = 1 end
if classic == nil then classic = 1 end
if legacy == nil then legacy = 1 end
if blue == nil then blue = 1 end
if green == nil then green = 1 end
if red == nil then red = 1 end
if lime == nil then lime = 1 end
if evolve01 == nil then evolve01 = 1 end
if evolve02 == nil then evolve02 = 1 end
if evolve03 == nil then evolve03 = 1 end

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('logoreload',function() lua_thread.create(function() s = thisScript() s:reload() end)  end)
    sampAddChatMessage('Logo by MaGnAt',-1)
    sampRegisterChatCommand('logo',function(param)
                                            if onServer == 'diamond' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if diamondServ == 'emerald' then emerald = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'trilliant' then trilliant = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'crystal' then crystal = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'sapphire' then sapphire = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'amber' then amber = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'ruby' then ruby = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'gold' then gold = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end

                                                end
                                            end
                                            if onServer == 'arizona' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if arizonaServ == 'phoenix' then phoenix = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'tucson' then tucson = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'scottdale' then scottdale = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'chandler' then chandler = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'brainburg' then brainburg = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'saint rose' then saintrose = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'mesa' then mesa = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'red rock' then redrock = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'yuma' then yuma = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'surprise' then surprise = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'prescott' then prescott = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'glendale' then glendale = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'kingman' then kingman = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'winslow' then winslow = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'payson' then payson = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'gilbert' then gilbert = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'show low' then showlow = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'casa grande' then casagrande = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'page' then page = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'sun city' then suncity = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'queen creek' then queencreek = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'sedona' then sedona = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))  
                                                    end
                                                end
                                            end
                                            if onServer == 'samprp' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if samprpServ == 'srp02' then srp02 = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if samprpServ == 'revolution' then revolution = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if samprpServ == 'classic' then classic = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if samprpServ == 'legacy' then legacy = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                end
                                            end
                                            if onServer == 'advance' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if advanceServer == 'blue' then blue = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(blue), -1)
                                                        sprite = loadSprite(blue)
                                                    end
                                                    if advanceServer == 'red' then red = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(red), -1)
                                                        sprite = loadSprite(red)
                                                    end
                                                    if advanceServer == 'green' then green = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(green), -1)
                                                        sprite = loadSprite(green)
                                                    end
                                                    if advanceServer == 'lime' then lime = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(lime), -1)
                                                        sprite = loadSprite(lime)
                                                    end
                                                end
                                            end
                                            if onServer == 'evolve' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if servevolve == 'ev01' then evolve01 = tonumber(param)
                                                       
                                                        writeServ()
                                                        sprite = loadSprite(evolve01)
                                                    end
                                                    if servevolve == 'ev02' then evolve02 = tonumber(param)
                                                        writeServ()
                                                        sprite = loadSprite(evolve02)
                                                    end
                                                    if servevolve == 'ev03' then evolve03 = tonumber(param)
                                                        writeServ()
                                                        sprite = loadSprite(evolve03)
                                                    end
                                                end
                                            end
                                    end)
                                    --sampRegisterChatCommand('tdr',function(param) print(sampTextdrawGetPos(param)) end)

        lua_thread.create(function()
            while sampGetCurrentServerName() == "SA-MP" do wait(0) end
            wait(500)

                if sampGetCurrentServerName():match("Diamond") then
                    onServer = 'diamond'      
                    act = true
                elseif sampGetCurrentServerName():match("Arizona") then
                    onServer = 'arizona'      
                    act = true
                elseif sampGetCurrentServerName():match("Samp.+Rp") then
                    onServer = 'samprp'
                    sampTextdrawDelete(0)
                    act = true
                elseif sampGetCurrentServerName():match("Advance") then
                    onServer = 'advance'
                    print('advance server')
                    act = true
                elseif sampGetCurrentServerName():match("Evolve") then
                    onServer = 'evolve'
                    print('evolve server')
                    act = true
                end
                wait(1000)
 
                if onServer == 'diamond' then
                    servername = sampGetCurrentServerName()
                    if servername:find('Emerald') then
                        diamondServ = 'emerald'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(emerald)
                    elseif servername:find('Trilliant') then
                        diamondServ = 'trilliant'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(trilliant)
                    elseif servername:find('Crystal') then
                        diamondServ = 'crystal'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(crystal)
                    elseif servername:find('Sapphire') then
                        diamondServ = 'sapphire'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(sapphire)
                    elseif servername:find('Amber') then
                        diamondServ = 'amber'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(amber)
                    elseif servername:find('Ruby') then
                        diamondServ = 'ruby'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(ruby)
                    elseif servername:find('Gold') then
                        diamondServ = 'gold'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(gold)
                    end
                    --for i = 177, 188 do
                        --sampTextdrawDelete(i)
                    --end
                end
                if onServer == 'arizona' then
                    servername = sampGetCurrentServerName()
                    if servername:find('Phoenix') then
                        arizonaServ = 'phoenix'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(phoenix)
                    elseif servername:find('Tucson') then
                        arizonaServ = 'tucson'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(tucson)
                    elseif servername:find('Scottdale') then
                        arizonaServ = 'scottdale'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(scottdale)
                    elseif servername:find('Chandler') then
                        arizonaServ = 'chandler'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(chandler)
                    elseif servername:find('Brainburg') then
                        arizonaServ = 'brainburg'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(brainburg)
                    elseif servername:find('SaintRose') then
                        arizonaServ = 'saint rose'
                        IsLoaded = loadTextureDictionary('saintrose')
                        sprite = loadSprite(saintrose)
                    elseif servername:find('Mesa') then
                        arizonaServ = 'mesa'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(mesa)
                    elseif servername:find('Red.Rock') then
                        arizonaServ = 'red rock'
                        IsLoaded = loadTextureDictionary('redrock')
                        sprite = loadSprite(redrock)
                    elseif servername:find('Yuma') then
                        arizonaServ = 'yuma'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(yuma)
                    elseif servername:find('Surprise') then
                        arizonaServ = 'surprise'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(surprise)
                    elseif servername:find('Prescott') then
                        arizonaServ = 'prescott'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(prescott)
                    elseif servername:find('Glendale') then
                        arizonaServ = 'glendale'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(glendale)
                    elseif servername:find('Kingman') then
                        arizonaServ = 'kingman'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(kingman)
                    elseif servername:find('Winslow') then
                        arizonaServ = 'winslow'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(winslow)
                    elseif servername:find('Payson') then
                        arizonaServ = 'payson'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(payson)
                    elseif servername:find('Gilbert') then
                        arizonaServ = 'gilbert'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(gilbert)
                    elseif servername:find('Show.Low') then
                        arizonaServ = 'show low'
                        IsLoaded = loadTextureDictionary('showlow')
                        sprite = loadSprite(showlow)
                    elseif servername:find('Casa.Grande') then
                        arizonaServ = 'casa grande'
                        IsLoaded = loadTextureDictionary('casagrande')
                        sprite = loadSprite(casagrande)
                    elseif servername:find('Page') then
                        arizonaServ = 'page'
                        IsLoaded = loadTextureDictionary('page')
                        sprite = loadSprite(page)
                    elseif servername:find('Sun.City') then
                        arizonaServ = 'sun city'
                        IsLoaded = loadTextureDictionary('suncity')
                        sprite = loadSprite(suncity)
                    elseif servername:find('Queen.Creek') then
                        arizonaServ = 'queen creek'
                        IsLoaded = loadTextureDictionary('queencreek')
                        sprite = loadSprite(queencreek)
                    elseif servername:find('Sedona') then
                        arizonaServ = 'sedona'
                        IsLoaded = loadTextureDictionary('sedona')
                        sprite = loadSprite(sedona)                      
                    end

                end
                if onServer == 'samprp' then
                    servername = sampGetCurrentServerName()
                    if servername:find('02') then
                        samprpServ = 'srp02'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(srp02)
                    elseif servername:find('Revolution') then
                        samprpServ = 'revolution'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(revolution)
                    elseif servername:find('Classic') then
                        samprpServ = 'classic'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(classic)
                    elseif servername:find('Legacy') then
                        samprpServ = 'legacy'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(legacy)
                    end
                end
                if onServer == 'advance' then
                   
                    servername = sampGetCurrentServerName()
                    --sampAddChatMessage(tostring(servername), -1)
                    if servername:find('Advance RolePlay (.+)') then
                        advanceNum = servername:match('Advance RolePlay (.+)')
                        --sampAddChatMessage(tostring(advanceNum), -1)
                        if advanceNum:find('Blue') then
                            advanceServer = 'blue'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(blue)
                        elseif advanceNum:find('Green') then
                            advanceServer = 'green'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(green)
                        elseif advanceNum:find('Red') then
                            advanceServer = 'red'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(red)
                        elseif advanceNum:find('Lime') then
                            advanceServer = 'lime'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(lime)
                        end
                        for i = 125, 138 do
                            sampTextdrawDelete(i)
                        end
                    end
                end
                if onServer == 'evolve' then
                    servername = sampGetCurrentServerName()
                    if servername:find('Server: 01') then print('evolve 01') servevolve = 'ev01' IsLoaded = loadTextureDictionary(servevolve) sprite = loadSprite(evolve01)
                    elseif servername:find('Server: 02') then print('evolve 02') servevolve = 'ev02' IsLoaded = loadTextureDictionary(servevolve) sprite = loadSprite(evolve02)
                    elseif servername:find('Server: 03') then print('evolve 03') servevolve = 'ev03' IsLoaded = loadTextureDictionary(servevolve) sprite = loadSprite(evolve03) end
                    for i = 379, 392 do
                        sampTextdrawDelete(i)
                    end          
                end
        end)
--[[[ML] (script) Logo by MaGnAt : 563   14
[ML] (script) Logo by MaGnAt : 565   6
[ML] (script) Logo by MaGnAt : 550   1]]
    lua_thread.create(function()
        while true do
            wait(1)
           
            if sprite ~= nil and act then
                drawSprite(sprite, 589, 20, 76, 38, 255, 255, 255, 255)
            end
        end
    end)
end

function q.onShowTextDraw(id, data)
    --print(data.position.x,data.position.y,id)
    if data.position.x  > 530 and data.position.y < 26 then
        return false
    end
    if sampGetCurrentServerName():match("Diamond") then
        onServer = 'diamond'
    elseif sampGetCurrentServerName():match("Arizona") then
        onServer = 'arizona'
        if data.position.y >= 1 and data.position.y < 50 and data.position.x < 603 and data.position.x > 500 then
            return false
        end
    elseif sampGetCurrentServerName():match("Samp.+Rp") and id == 0 then
        onServer = 'samprp'
        return false
    elseif sampGetCurrentServerName():match("Advance") then
        onServer = 'advance'
        print('advance server')
        act = true
        for i = 9, 22 do
            sampTextdrawDelete(i)
        end
    elseif sampGetCurrentServerName():match("Evolve") then
        onServer = 'evolve'
        print('evolve server')
        act = true
    end
end

function writeServ()
    result = inicfg.save({main = {
        emerald   = emerald,
        trilliant = trilliant,
        crystal  = crystal,
        sapphire = sapphire,
        amber = amber,
        ruby = ruby,
        gold  = gold,
        phoenix         = phoenix,    
        tucson          = tucson,      
        scottdale       = scottdale,      
        chandler        = chandler,    
        brainburg       = brainburg,      
        saintrose       = saintrose,      
        mesa            = mesa,          
        redrock         = redrock,        
        yuma            = yuma,          
        surprise        = surprise,      
        prescott        = prescott,      
        glendale        = glendale,      
        kingman         = kingman,  
        winslow = winslow,
        payson = payson,
        gilbert         = gilbert,
        showlow         = showlow,
        casagrande      = casagrande,
        page            = page,
        suncity         = suncity,
        queencreek      = queencreek,
        sedona          = sedona,
        srp02       = srp02,  
        revolution  = revolutio,
        classic     = classic,
        legacy      = legacy,
        blue = blue,
        green = green,
        red = red,
        lime = lime,
        evolve01 = evolve01,
        evolve02 = evolve02,
        evolve03 = evolve03              }},"moonloader/config/" .. thisScript().name .. ".ini")
end
 
  • Нравится
Реакции: Poopseek и mentaletion

Tensay

Активный
169
51
Попробуй, в main одного end не хватало
123123:
local q = require 'lib.samp.events'
script_name("NewLogo by Clyde Mods")
script_description('https://www.blast.hk/members/437308/')
local inicfg = require 'inicfg'
local logo = 1
local act = false
if not doesDirectoryExist("moonloader/config") then
    os.execute('md "'..getWorkingDirectory()..'/config"')
    local f = io.open("moonloader/config", "w")
end
if not doesFileExist("moonloader/config/" .. thisScript().name .. ".ini") then
    local f = io.open("moonloader/config/" .. thisScript().name .. ".ini", "w")
    if f then
        f:write('\nphoenix = 1 \ntucson = 1 \nscottdale = 1 \nchandler = 1\nbrainburg = 1\nsaintrose = 1\nmesa = 1\nredrock = 1\nyuma = 1\nsurprise = 1\nprescott = 1\nglendale = 1\nkingman = 1\nwinslow = 1\npayson = 1\ngilbert = 1\nshowlow = 1\ncasagrande = 1\npage = 1\nsuncity = 1\nqueencreek = 1\nsedona = 1')
        f:close()
    end
    
end

local phoenix       = 1
local tucson       = 1
local scottdale       = 1
local chandler       = 1
local brainburg       = 1
local saintrose       = 1
local mesa       = 1
local redrock       = 1
local yuma       = 1
local surprise       = 1
local prescott       = 1
local glendale       = 1
local kingman       = 1
local winslow = 1
local payson = 1
local gilbert      = 1
local showlow      = 1
local casagrande      = 1
local page      = 1
local suncity      = 1
local queencreek      = 1
local sedona      = 1

mainIni = inicfg.load(nil,  "moonloader/config/" .. thisScript().name .. ".ini")
emerald     = mainIni.main.emerald
trilliant    = mainIni.main.gretrilliant
crystal     =  mainIni.main.crystal
sapphire     =  mainIni.main.sapphire
amber   = mainIni.main.amber
ruby    = mainIni.main.ruby
gold    = mainIni.main.gold
phoenix         = mainIni.main.phoenix   
tucson          = mainIni.main.tucson   
scottdale       = mainIni.main.scottdale
chandler        = mainIni.main.chandler
brainburg       = mainIni.main.brainburg
saintrose       = mainIni.main.saintrose
mesa            = mainIni.main.mesa     
redrock         = mainIni.main.redrock   
yuma            = mainIni.main.yuma     
surprise        = mainIni.main.surprise
prescott        = mainIni.main.prescott
glendale        = mainIni.main.glendale
kingman         = mainIni.main.kingman
winslow = mainIni.main.winslow
payson = mainIni.main.payson
gilbert         = mainIni.main.gilbert
showlow         = mainIni.main.showlow
casagrande      = mainIni.main.casagrande
page            = mainIni.main.page
suncity         = mainIni.main.suncity
queencreek      = mainIni.main.queencreek
sedona          = mainIni.main.sedona
srp02       = mainIni.main.srp02
revolution  = mainIni.main.revolution
classic     = mainIni.main.classic
legacy      = mainIni.main.legacy
blue = mainIni.main.blue
green = mainIni.main.green
red =  mainIni.main.red
lime =  mainIni.main.lime
evolve01 = mainIni.main.evolve01
evolve02 = mainIni.main.evolve02
evolve03 = mainIni.main.evolve03
blue = mainIni.main.blue
green = mainIni.main.green
red =  mainIni.main.red
lime =  mainIni.main.lime
evolve01 = mainIni.main.evolve01
evolve02 = mainIni.main.evolve02
evolve03 = mainIni.main.evolve03

if emerald == nil then emerald = 1 end
if trilliant == nil then trilliant = 1 end
if crystal == nil then crystal = 1 end
if sapphire == nil then sapphire = 1 end
if amber == nil then amber = 1 end
if ruby == nil then ruby = 1 end
if gold == nil then gold = 1 end
if  phoenix   == nil then phoenix = 1 end
if  tucson   == nil then tucson = 1 end
if  scottdale   == nil then scottdale = 1 end
if  chandler   == nil then chandler = 1 end
if  brainburg   == nil then brainburg = 1 end
if  saintrose   == nil then saintrose = 1 end
if  mesa   == nil then mesa = 1 end
if  redrock   == nil then redrock = 1 end
if  yuma   == nil then yuma = 1 end
if  surprise   == nil then surprise = 1 end
if  prescott   == nil then prescott = 1 end
if  glendale   == nil then glendale = 1 end
if  kingman   == nil then kingman = 1 end
if  winslow   == nil then winslow = 1 end
if  payson   == nil then payson = 1 end
if  gilbert   == nil then gilbert = 1 end
if  showlow   == nil then showlow = 1 end
if  casagrande   == nil then casagrande = 1 end
if  page   == nil then page = 1 end
if  suncity   == nil then suncity = 1 end
if  queencreek   == nil then queencreek = 1 end
if  sedona   == nil then sedona = 1 end
if srp02 == nil then srp02 = 1 end
if revolution == nil then revolution = 1 end
if classic == nil then classic = 1 end
if legacy == nil then legacy = 1 end
if blue == nil then blue = 1 end
if green == nil then green = 1 end
if red == nil then red = 1 end
if lime == nil then lime = 1 end
if evolve01 == nil then evolve01 = 1 end
if evolve02 == nil then evolve02 = 1 end
if evolve03 == nil then evolve03 = 1 end

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('logoreload',function() lua_thread.create(function() s = thisScript() s:reload() end)  end)
    sampAddChatMessage('Logo by MaGnAt',-1)
    sampRegisterChatCommand('logo',function(param)
                                            if onServer == 'diamond' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if diamondServ == 'emerald' then emerald = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'trilliant' then trilliant = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'crystal' then crystal = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'sapphire' then sapphire = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'amber' then amber = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'ruby' then ruby = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if diamondServ == 'gold' then gold = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..diamondServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end

                                                end
                                            end
                                            if onServer == 'arizona' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if arizonaServ == 'phoenix' then phoenix = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'tucson' then tucson = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'scottdale' then scottdale = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'chandler' then chandler = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'brainburg' then brainburg = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'saint rose' then saintrose = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'mesa' then mesa = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'red rock' then redrock = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'yuma' then yuma = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'surprise' then surprise = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'prescott' then prescott = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'glendale' then glendale = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'kingman' then kingman = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'winslow' then winslow = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'payson' then payson = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    if arizonaServ == 'gilbert' then gilbert = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'show low' then showlow = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'casa grande' then casagrande = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'page' then page = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'sun city' then suncity = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'queen creek' then queencreek = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if arizonaServ == 'sedona' then sedona = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))   
                                                    end
                                                end
                                            end
                                            if onServer == 'samprp' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if samprpServ == 'srp02' then srp02 = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if samprpServ == 'revolution' then revolution = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if samprpServ == 'classic' then classic = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                    if samprpServ == 'legacy' then legacy = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage('Новый номер логотипа для сервера '..samprpServ..' - '..tonumber(param), -1)
                                                        sprite = loadSprite(tonumber(param))
                                                    end
                                                end
                                            end
                                            if onServer == 'advance' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if advanceServer == 'blue' then blue = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(blue), -1)
                                                        sprite = loadSprite(blue)
                                                    end
                                                    if advanceServer == 'red' then red = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(red), -1)
                                                        sprite = loadSprite(red)
                                                    end
                                                    if advanceServer == 'green' then green = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(green), -1)
                                                        sprite = loadSprite(green)
                                                    end
                                                    if advanceServer == 'lime' then lime = tonumber(param)
                                                        writeServ()
                                                        sampAddChatMessage(tostring(lime), -1)
                                                        sprite = loadSprite(lime)
                                                    end
                                                end
                                            end
                                            if onServer == 'evolve' then
                                                if tonumber(param) >= 1 and tonumber(param) <= 6 then
                                                    if servevolve == 'ev01' then evolve01 = tonumber(param)
                                                        
                                                        writeServ()
                                                        sprite = loadSprite(evolve01)
                                                    end
                                                    if servevolve == 'ev02' then evolve02 = tonumber(param)
                                                        writeServ()
                                                        sprite = loadSprite(evolve02)
                                                    end
                                                    if servevolve == 'ev03' then evolve03 = tonumber(param)
                                                        writeServ()
                                                        sprite = loadSprite(evolve03)
                                                    end
                                                end
                                            end
                                    end
                            end)
                                    --sampRegisterChatCommand('tdr',function(param) print(sampTextdrawGetPos(param)) end)

        lua_thread.create(function()
            while sampGetCurrentServerName() == "SA-MP" do wait(0) end
            wait(500)

                if sampGetCurrentServerName():match("Diamond") then
                    onServer = 'diamond'       
                    act = true
                elseif sampGetCurrentServerName():match("Arizona") then
                    onServer = 'arizona'       
                    act = true
                elseif sampGetCurrentServerName():match("Samp.+Rp") then
                    onServer = 'samprp'
                    sampTextdrawDelete(0)
                    act = true
                elseif sampGetCurrentServerName():match("Advance") then
                    onServer = 'advance'
                    print('advance server')
                    act = true
                elseif sampGetCurrentServerName():match("Evolve") then
                    onServer = 'evolve'
                    print('evolve server')
                    act = true
                end
                wait(1000)
 
                if onServer == 'diamond' then
                    servername = sampGetCurrentServerName()
                    if servername:find('Emerald') then
                        diamondServ = 'emerald'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(emerald)
                    elseif servername:find('Trilliant') then
                        diamondServ = 'trilliant'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(trilliant)
                    elseif servername:find('Crystal') then
                        diamondServ = 'crystal'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(crystal)
                    elseif servername:find('Sapphire') then
                        diamondServ = 'sapphire'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(sapphire)
                    elseif servername:find('Amber') then
                        diamondServ = 'amber'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(amber)
                    elseif servername:find('Ruby') then
                        diamondServ = 'ruby'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(ruby)
                    elseif servername:find('Gold') then
                        diamondServ = 'gold'
                        IsLoaded = loadTextureDictionary(diamondServ)
                        sprite = loadSprite(gold)
                    end
                    --for i = 177, 188 do
                        --sampTextdrawDelete(i)
                    --end
                end
                if onServer == 'arizona' then
                    servername = sampGetCurrentServerName()
                    if servername:find('Phoenix') then
                        arizonaServ = 'phoenix'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(phoenix)
                    elseif servername:find('Tucson') then
                        arizonaServ = 'tucson'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(tucson)
                    elseif servername:find('Scottdale') then
                        arizonaServ = 'scottdale'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(scottdale)
                    elseif servername:find('Chandler') then
                        arizonaServ = 'chandler'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(chandler)
                    elseif servername:find('Brainburg') then
                        arizonaServ = 'brainburg'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(brainburg)
                    elseif servername:find('SaintRose') then
                        arizonaServ = 'saint rose'
                        IsLoaded = loadTextureDictionary('saintrose')
                        sprite = loadSprite(saintrose)
                    elseif servername:find('Mesa') then
                        arizonaServ = 'mesa'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(mesa)
                    elseif servername:find('Red.Rock') then
                        arizonaServ = 'red rock'
                        IsLoaded = loadTextureDictionary('redrock')
                        sprite = loadSprite(redrock)
                    elseif servername:find('Yuma') then
                        arizonaServ = 'yuma'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(yuma)
                    elseif servername:find('Surprise') then
                        arizonaServ = 'surprise'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(surprise)
                    elseif servername:find('Prescott') then
                        arizonaServ = 'prescott'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(prescott)
                    elseif servername:find('Glendale') then
                        arizonaServ = 'glendale'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(glendale)
                    elseif servername:find('Kingman') then
                        arizonaServ = 'kingman'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(kingman)
                    elseif servername:find('Winslow') then
                        arizonaServ = 'winslow'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(winslow)
                    elseif servername:find('Payson') then
                        arizonaServ = 'payson'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(payson)
                    elseif servername:find('Gilbert') then
                        arizonaServ = 'gilbert'
                        IsLoaded = loadTextureDictionary(arizonaServ)
                        sprite = loadSprite(gilbert)
                    elseif servername:find('Show.Low') then
                        arizonaServ = 'show low'
                        IsLoaded = loadTextureDictionary('showlow')
                        sprite = loadSprite(showlow)
                    elseif servername:find('Casa.Grande') then
                        arizonaServ = 'casa grande'
                        IsLoaded = loadTextureDictionary('casagrande')
                        sprite = loadSprite(casagrande)
                    elseif servername:find('Page') then
                        arizonaServ = 'page'
                        IsLoaded = loadTextureDictionary('page')
                        sprite = loadSprite(page)
                    elseif servername:find('Sun.City') then
                        arizonaServ = 'sun city'
                        IsLoaded = loadTextureDictionary('suncity')
                        sprite = loadSprite(suncity)
                    elseif servername:find('Queen.Creek') then
                        arizonaServ = 'queen creek'
                        IsLoaded = loadTextureDictionary('queencreek')
                        sprite = loadSprite(queencreek)
                    elseif servername:find('Sedona') then
                        arizonaServ = 'sedona'
                        IsLoaded = loadTextureDictionary('sedona')
                        sprite = loadSprite(sedona)                       
                    end

                end
                if onServer == 'samprp' then
                    servername = sampGetCurrentServerName()
                    if servername:find('02') then
                        samprpServ = 'srp02'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(srp02)
                    elseif servername:find('Revolution') then
                        samprpServ = 'revolution'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(revolution)
                    elseif servername:find('Classic') then
                        samprpServ = 'classic'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(classic)
                    elseif servername:find('Legacy') then
                        samprpServ = 'legacy'
                        IsLoaded = loadTextureDictionary(samprpServ)
                        sprite = loadSprite(legacy)
                    end
                end
                if onServer == 'advance' then
                    
                    servername = sampGetCurrentServerName()
                    --sampAddChatMessage(tostring(servername), -1)
                    if servername:find('Advance RolePlay (.+)') then
                        advanceNum = servername:match('Advance RolePlay (.+)')
                        --sampAddChatMessage(tostring(advanceNum), -1)
                        if advanceNum:find('Blue') then
                            advanceServer = 'blue'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(blue)
                        elseif advanceNum:find('Green') then
                            advanceServer = 'green'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(green)
                        elseif advanceNum:find('Red') then
                            advanceServer = 'red'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(red)
                        elseif advanceNum:find('Lime') then
                            advanceServer = 'lime'
                            IsLoaded = loadTextureDictionary(advanceServer)
                            sprite = loadSprite(lime)
                        end
                        for i = 125, 138 do
                            sampTextdrawDelete(i)
                        end
                    end
                end
                if onServer == 'evolve' then
                    servername = sampGetCurrentServerName()
                    if servername:find('Server: 01') then print('evolve 01') servevolve = 'ev01' IsLoaded = loadTextureDictionary(servevolve) sprite = loadSprite(evolve01)
                    elseif servername:find('Server: 02') then print('evolve 02') servevolve = 'ev02' IsLoaded = loadTextureDictionary(servevolve) sprite = loadSprite(evolve02)
                    elseif servername:find('Server: 03') then print('evolve 03') servevolve = 'ev03' IsLoaded = loadTextureDictionary(servevolve) sprite = loadSprite(evolve03) end
                    for i = 379, 392 do
                        sampTextdrawDelete(i)
                    end           
                end
        end)
--[[[ML] (script) Logo by MaGnAt : 563   14
[ML] (script) Logo by MaGnAt : 565   6
[ML] (script) Logo by MaGnAt : 550   1]]
    lua_thread.create(function()
        while true do
            wait(1)
            
            if sprite ~= nil and act then
                drawSprite(sprite, 589, 20, 76, 38, 255, 255, 255, 255)
            end
        end
    end)
end

function q.onShowTextDraw(id, data)
    --print(data.position.x,data.position.y,id)
    if data.position.x  > 530 and data.position.y < 26 then
        return false
    end
    if sampGetCurrentServerName():match("Diamond") then
        onServer = 'diamond'
    elseif sampGetCurrentServerName():match("Arizona") then
        onServer = 'arizona'
        if data.position.y >= 1 and data.position.y < 50 and data.position.x < 603 and data.position.x > 500 then
            return false
        end
    elseif sampGetCurrentServerName():match("Samp.+Rp") and id == 0 then
        onServer = 'samprp'
        return false
    elseif sampGetCurrentServerName():match("Advance") then
        onServer = 'advance'
        print('advance server')
        act = true
        for i = 9, 22 do
            sampTextdrawDelete(i)
        end
    elseif sampGetCurrentServerName():match("Evolve") then
        onServer = 'evolve'
        print('evolve server')
        act = true
    end
end

function writeServ()
    result = inicfg.save({main = {
        emerald   = emerald,
        trilliant = trilliant,
        crystal  = crystal,
        sapphire = sapphire,
        amber = amber,
        ruby = ruby,
        gold  = gold,
        phoenix         = phoenix,     
        tucson          = tucson,       
        scottdale       = scottdale,       
        chandler        = chandler,     
        brainburg       = brainburg,       
        saintrose       = saintrose,       
        mesa            = mesa,           
        redrock         = redrock,         
        yuma            = yuma,           
        surprise        = surprise,       
        prescott        = prescott,       
        glendale        = glendale,       
        kingman         = kingman,   
        winslow = winslow,
        payson = payson,
        gilbert         = gilbert,
        showlow         = showlow,
        casagrande      = casagrande,
        page            = page,
        suncity         = suncity,
        queencreek      = queencreek,
        sedona          = sedona,
        srp02       = srp02,   
        revolution  = revolutio,
        classic     = classic,
        legacy      = legacy,
        blue = blue,
        green = green,
        red = red,
        lime = lime,
        evolve01 = evolve01,
        evolve02 = evolve02,
        evolve03 = evolve03              }},"moonloader/config/" .. thisScript().name .. ".ini")
end
 
  • Нравится
Реакции: mentaletion