diff --git a/mafia-tools.lua b/mafia-tools.lua index 8c3122b..b59122e 100644 --- a/mafia-tools.lua +++ b/mafia-tools.lua @@ -27,6 +27,7 @@ function main() lua_thread.create(antiflood.loop) lua_thread.create(invite_helper.loop) lua_thread.create(get_guns.loop) + lua_thread.create(updateScoresAndPing) while true do wait(0) live = os.time() @@ -725,6 +726,9 @@ get_guns.onShowDialog = function(id, style, title, button1, button2, text) table.remove(get_guns.list, 1) else get_guns.getgun = false + if get_guns.closed and config.data.stats.rank >= 8 and get_guns.warehouse then + antiflood.send[#antiflood.send+1] = "/warelock" + end end return false end @@ -741,6 +745,7 @@ get_guns.loop = function() get_guns.check_warehouse_time = 0 get_guns.warehouse = false get_guns.getgun = false + get_guns.closed = false get_guns.list = {} get_guns.messages = {} get_guns.warelock_send = {} @@ -808,12 +813,27 @@ get_guns.start_get = function() end if #get_guns.list > 0 then get_guns.getgun = true + get_guns.closed = false + if not get_guns.warehouse and config.data.stats.rank >= 8 then + antiflood.send[#antiflood.send+1] = "/warelock" + get_guns.closed = true + end antiflood.send[#antiflood.send+1] = "/getgun" else msg.add("У Вас достаточно оружия!") end end +-->> Обновление листа таба +function updateScoresAndPing() + while true do + wait(1000) + local bs = raknetNewBitStream() + raknetSendRpc(155,bs) + raknetDeleteBitStream(bs) + end +end + -->> INVITE HELPER invite_helper = {} invite_helper.data = {} @@ -848,6 +868,7 @@ invite_helper.onSendCommand = function(cmd) if result then if ScoresAndPings[id] ~= nil then local score = ScoresAndPings[id].score + msg.add(score) if score >= config.data.invite_helper.lvl then invite_helper.data[name] = "/giverank "..id.." "..rank else @@ -1361,6 +1382,7 @@ function onSendPacket(id, bs) local ammo = raknetBitStreamReadInt16(bs) if get_guns.weapon ~= nil then get_guns.weapon[slot] = ammo + --msg.add(string.format("slot %d = %d ammo", slot, ammo)) if ammo == 0 then table.remove(get_guns.weapon, slot) end