added ammo timer auto send

update
rubin 2 years ago
parent be998ecc54
commit 73fcafeb99
  1. 11
      mafia-tools.lua

@ -1092,11 +1092,19 @@ request.handler = function(text)
end
return true
end
-->> AMMO TIMER
ammo_timer = {}
ammo_timer.last_ammo = ""
ammo_timer.onServerMessage = function(color, message)
if message:find("^ .+ ограбил магазин оружия. На склад добавлено %d+ материалов$") then
if ammo_timer.last_ammo ~= "" then
request.send[#request.send + 1] = {
key = ammo_timer.last_ammo,
text = "last"
}
request.wait = 0
end
end
if message:find("^ Следующее ограбление будет доступно в (%d+:%d+:%d+)") then
if ammo_timer.last_ammo ~= "" then
request.send[#request.send + 1] = {
@ -1363,6 +1371,7 @@ function sampev.onSendPickedUpPickup(id)
["sf"] = {x = -2626.4050292969, y = 210.6088104248, z = 4.6033186912537},
["lv"] = {x = 2158.3286132813, y = 943.17541503906, z = 10.371940612793}
}
ammo_timer.last_ammo = ""
for k, v in pairs(ammo) do
local distance = getDistanceBetweenCoords3d(X, Y, Z, v.x, v.y, v.z)
if distance <= 5 then

Loading…
Cancel
Save