local hp = 375
-----------------------------------------------
local СОСИТЕ_ХУЙ_СТРАХОВЩИКИ = false
local inicfg = require 'inicfg'
local directIni = 'AntiExplosionByChapo.ini'
local ini = inicfg.load(inicfg.load({
main = {
enabled = true
},
}, directIni))
inicfg.save(ini, directIni)
local active = ini.main.enabled
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('antiexp', function()
active = not active
sampAddChatMessage('Anti-Explosion by chapo: '..(active and 'on' or 'off'), -1)
ini.main.enabled = active
inicfg.save(ini, directIni)
end)
while true do
wait(0)
if active and isCharInAnyCar(PLAYER_PED) then
local veh = storeCarCharIsInNoSave(PLAYER_PED)
if getCarHealth(veh) < hp then
СОСИТЕ_ХУЙ_СТРАХОВЩИКИ = true
sampProcessChatInput("/rec") -- поменяй на твою команду реконекта если она не /rec
printStringNow('~r~Anti-Explosion', 1000)
end
else
СОСИТЕ_ХУЙ_СТРАХОВЩИКИ = false
end
end
end
local sampev = require 'lib.samp.events'
function sampev.onSendVehicleSync(data)
if СОСИТЕ_ХУЙ_СТРАХОВЩИКИ then
--sampAddChatMessage('vehSync->data->vehicleHealth: returned 251', -1)
data.vehicleHealth = hp
return data
end
end