- 22
- 1
Здраствуй, я нашел в интернетике скрипт лого фармзона рпг посмотрел папку ресурс моего сервера там не было, открыл код понял чо писать но кажись не понял помогите его дополнить пожалуйста
вот как сделать из этого рабочий скрипт
Lua:
local q = require 'lib.samp.events'
script_name("New Logo by Ambient Mods and VovaS Sсripts ")
script_description('vk.com/ambientmods vk.com/vovascripts')
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('[main] \nemerald = 1 \ntrilliant = 1\ncrystal = 1\nsapphire = 1 \namber = 1\nruby = 1\ngold = 1')
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\ngilbert = 1')
f:write('\nsrp02 = 1 \nrevolution = 1\nclassic = 1\nlegacy = 1 ')
f:write('\nblue = 1 \ngreen = 1\nred = 1\nlime = 1 \nevolve01 = 1\nevolve02 = 1\nevolve03 = 1')
f:close()
end
end
local blue = 1
local green = 1
local red = 1
local lime = 1
local evolve01 = 1
local evolve02 = 1
local evolve03 = 1
local emerald = 1
local trilliant = 1
local crystal = 1
local sapphire = 1
local amber = 1
local ruby = 1
local gold = 1
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 gilbert = 1
local holiday = 1
local srp02 = 1
local revolution = 1
local classic = 1
local legacy = 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
gilbert = mainIni.main.gilbert
holiday = mainIni.main.holiday
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 gilbert == nil then gilbert = 1 end
if holiday == nil then holiday = 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('New Logo by Ambient Mods & VovaS Sripts',-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 == 'gilbert' then gilbert = tonumber(param)
writeServ()
sampAddChatMessage('Новый номер логотипа для сервера '..arizonaServ..' - '..tonumber(param), -1)
sprite = loadSprite(tonumber(param))
end
if arizonaServ == 'Holiday' then Holiday = 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('Gilbert') then
arizonaServ = 'gilbert'
IsLoaded = loadTextureDictionary(arizonaServ)
sprite = loadSprite(gilbert)
elseif servername:find('Holiday') then
arizonaServ = 'Holiday'
IsLoaded = loadTextureDictionary(arizonaServ)
sprite = loadSprite(Holiday)
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) New Logo by Ambient Mods and VovaS Sripts : 563 14
[ML] (script) New Logo by Ambient Mods and VovaS Sripts : 565 6
[ML] (script) New Logo by Ambient Mods and VovaS Sripts : 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,
holiday = holiday,
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
вот как сделать из этого рабочий скрипт