Скрипт что если взрывается мавер ты реконектишься

YarikVL

Известный
Проверенный
4,713
1,802
Lua:
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
Этот скрипт https://www.blast.hk/threads/110783/ только сделал чтобы не ГМ был, а реконект
Нужно иметь скрипт, который реконектит тебя по команде ( например реконект версии 5.1 с группы в вк AIR Channel )