remove print score invite

update
rubin 2 years ago
parent 81d92331ce
commit 5ea9e874cc
  1. 36
      mafia-tools.lua

@ -28,6 +28,7 @@ function main()
lua_thread.create(invite_helper.loop) lua_thread.create(invite_helper.loop)
lua_thread.create(get_guns.loop) lua_thread.create(get_guns.loop)
lua_thread.create(updateScoresAndPing) lua_thread.create(updateScoresAndPing)
lua_thread.create(mafiawar.loop)
while true do while true do
wait(0) wait(0)
live = os.time() live = os.time()
@ -657,14 +658,39 @@ end
-->> MAFIAWAR -->> MAFIAWAR
mafiawar = {} mafiawar = {}
mafiawar.biz_id = -1 mafiawar.id = -1
mafiawar.biz = false mafiawar.biz = false
mafiawar.time = 0
mafiawar.onServerMessage = function(color, message) mafiawar.onServerMessage = function(color, message)
if message:find("^ Начать войну с этой мафией можно не раньше (%d+):00$") then
local hour = message:match("^ Начать войну с этой мафией можно не раньше (%d+):00$")
datetime = {
year = tonumber(os.date("%Y")),
month = tonumber(os.date("%m")),
day = tonumber(os.date("%d")),
hour = tonumber(hour),
min = 0,
sec = 0
}
mafiawar.time = os.time(datetime)
end
end end
mafiawar.onCreate3DText = function(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text) mafiawar.onCreate3DText = function(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text)
if text:find("Владелец") then if text:find("Владелец") then
mafiawar.id = id
mafiawar.biz = true
end
end
mafiawar.onRemove3DTextLabel = function(id)
if mafiawar.id == id then
mafiawar.id = -1
mafiawar.biz = false
end
end
mafiawar.loop = function()
while true do
wait(0)
if mafiawar.biz and mafiawar.time
end end
end end
@ -902,7 +928,6 @@ invite_helper.onSendCommand = function(cmd)
if result then if result then
if ScoresAndPings[id] ~= nil then if ScoresAndPings[id] ~= nil then
local score = ScoresAndPings[id].score local score = ScoresAndPings[id].score
msg.add(score)
if score >= config.data.invite_helper.lvl then if score >= config.data.invite_helper.lvl then
invite_helper.data[name] = "/giverank "..id.." "..rank invite_helper.data[name] = "/giverank "..id.." "..rank
else else
@ -1432,6 +1457,9 @@ end
function sampev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text) function sampev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text)
mafiawar.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text) mafiawar.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text)
end end
function sampev.onRemove3DTextLabel(id)
mafiawar.onRemove3DTextLabel(id)
end
function onSendPacket(id, bs) function onSendPacket(id, bs)
if id == 204 then if id == 204 then
raknetBitStreamIgnoreBits(bs,40) raknetBitStreamIgnoreBits(bs,40)

Loading…
Cancel
Save