added timer ffixcar

update
rubin 2 years ago
parent cc49fd7eb4
commit 944c2be930
  1. 66
      mafia-tools.lua

@ -122,7 +122,7 @@ menu.update = function()
["main"] = {
settings = {title = "mafia-tools" ,style = 4 ,btn1 = "Выбрать" ,btn2 = "Закрыть" ,forward = "{ffffff}" ,backwards = "\n" ,score = false},
{
{
{ -->> Синхронизация таймингов
title = "{"..config.data.font.color1.."}".."Синхронизация таймингов\t",
click = function(button, list, input , outs)
if button ~= 1 then return end
@ -171,18 +171,36 @@ menu.update = function()
menu.show = { true, "main" }
end
},
{ -->> Настройка отображения
title = "{"..config.data.font.color1.."}".."Настройка отображения\t",
{ -->> Настройки отображения
title = "{"..config.data.font.color1.."}".."Настройки отображения\t",
click = function(button, list, input , outs)
if button ~= 1 then return end
menu.show = { true, "main" }
end
},
{ -->> Рендер
title = "{"..config.data.font.color1.."}"..">{ffffff} Показать на экране\t"..(config.data.render and "вкл" or "выкл"),
title = "{"..config.data.font.color1.."}"..">{ffffff} Показать на экране\t"..(config.data.timer_hud.main and "вкл" or "выкл"),
click = function(button, list, input , outs)
if button ~= 1 then return end
config.data.render = not config.data.render
config.data.timer_hud.main = not config.data.timer_hud.main
config.save(config.data)
menu.show = { true, "main" }
end
},
{ -->> Показывать таймер mhcars
title = "{"..config.data.font.color1.."}"..">{ffffff} Показывать таймер mhcars\t"..(config.data.timer_hud.mhcars and "вкл" or "выкл"),
click = function(button, list, input , outs)
if button ~= 1 then return end
config.data.timer_hud.mhcars = not config.data.timer_hud.mhcars
config.save(config.data)
menu.show = { true, "main" }
end
},
{ -->> Показывать таймер ffixcar
title = "{"..config.data.font.color1.."}"..">{ffffff} Показывать таймер ffixcar\t"..(config.data.timer_hud.ffixcar and "вкл" or "выкл"),
click = function(button, list, input , outs)
if button ~= 1 then return end
config.data.timer_hud.ffixcar = not config.data.timer_hud.ffixcar
config.save(config.data)
menu.show = { true, "main" }
end
@ -292,6 +310,7 @@ request.handler = function(text)
sf = { time = 0, text = "00:00:00" },
lv = { time = 0, text = "00:00:00" },
mhcars = { time = 0, text = "00:00:00" },
ffixcar = { time = 0, text = "00:00:00" },
}
local isPlayerInList = function(sender)
local result = false
@ -358,40 +377,51 @@ ammo_timer.onServerMessage = function(color, message)
request.wait = 0
end
end --> by Richard_Holmes
if message:find(".+ заказал спавн транспорта через %d+ секунд%. С банка фракции снято %d+ вирт$") then
request.send[#request.send + 1] = {
key = "ffixcar",
text = ""
}
request.wait = 0
end
end
ammo_timer.data = {
ls = { time = 0, text = "00:00:00" },
sf = { time = 0, text = "00:00:00" },
lv = { time = 0, text = "00:00:00" },
mhcars = { time = 0, text = "00:00:00" },
ffixcar = { time = 0, text = "00:00:00" },
}
ammo_timer.loop = function()
font = renderCreateFont(config.data.font.name,config.data.font.size,config.data.font.flag)
local getText = function(key)
if config.data.timer_hud[key] ~= nil and not config.data.timer_hud[key] then
return ""
end
if ammo_timer.data[key]["time"] == 0 then
return string.format("{%s}%s:{%s} %s", config.data.font.color1, key:upper(), config.data.font.color2, ammo_timer.data[key]["text"])
return string.format("{%s}%s:{%s} %s\n", config.data.font.color1, key:upper(), config.data.font.color2, ammo_timer.data[key]["text"])
else
local min = math.floor((msk_time.get() - ammo_timer.data[key]["time"]) / 60)
return string.format("{%s}%s:{%s} %s (%d min)", config.data.font.color1, key:upper(), config.data.font.color2, ammo_timer.data[key]["text"], min)
return string.format("{%s}%s:{%s} %s (%d min)\n", config.data.font.color1, key:upper(), config.data.font.color2, ammo_timer.data[key]["text"], min)
end
end
while true do
wait(0)
if config.data.render then
if config.data.timer_hud.main then
if ammo_timer.setpos then
sampSetCursorMode(3)
local x, y = getCursorPos()
config.data.timer_pos.x = x
config.data.timer_pos.y = y
config.data.timer_hud.x = x
config.data.timer_hud.y = y
if isKeyJustPressed(1) then
sampSetCursorMode(0)
config.save(config.data)
ammo_timer.setpos = false
end
end
local text = string.format("%s\n%s\n%s\n%s", getText("ls"), getText("sf"), getText("lv"), getText("mhcars"))
renderFontDrawText(font,text,config.data.timer_pos.x,config.data.timer_pos.y,-1)
local text = string.format("%s%s%s%s%s", getText("ls"), getText("sf"), getText("lv"), getText("mhcars"), getText("ffixcar"))
renderFontDrawText(font,text,config.data.timer_hud.x,config.data.timer_hud.y,-1)
end
end
end
@ -440,15 +470,17 @@ config.default = {
color1 = "fffd8f",
color2 = "ffffff"
},
timer_pos = {
x = x1,
y = y1
},
time_2min = 0,
room = "all",
list = {}, -->> Список
list_block = true, -->> Использовать как Черный или Белый список
render = false
timer_hud = {
main = false,
mhcars = false,
ffixcar = false,
x = x1,
y = y1
}
}
config.directory = string.format("%s\\moonloader\\config\\%s\\", getGameDirectory(), thisScript().name)
config.init = function()

Loading…
Cancel
Save