Server editable.lua

--QB Dead event
RegisterNetEvent('hospital:server:SetDeathStatus', function(isDead)
    TriggerClientEvent("tgiann-zombie:isDead", source, isDead)
end)

RegisterNetEvent('hospital:server:SetLaststandStatus', function(bool)
    if bool then
        TriggerClientEvent("tgiann-zombie:isDead", source, bool)
    end
end)

local eventOn = false
local area = false

RegisterCommand(Config.commands["start"], function(source)
    if source == 0 or Config.test then
        if not eventOn then
            eventOn = true
            area = false
            TriggerClientEvent("tgiann-halloween:start-komut", -1)
        end
    end
end)

RegisterCommand(Config.commands["area"], function(source)
    if source == 0 or Config.test then
        if eventOn and not area then    
            area = true
            TriggerClientEvent("tgiann-halloween:alan", -1)
        end
    end
end)

RegisterCommand(Config.commands["finish"], function(source)
    if source == 0 or Config.test then
        if eventOn and area then    
            eventOn = false
            area = false
            TriggerClientEvent("tgiann-halloween:stop", -1)
        end
    end
end)

RegisterNetEvent("tgiann-zombie:check")
AddEventHandler("tgiann-zombie:check", function()
    if eventOn then TriggerClientEvent("tgiann-halloween:start", source, area) end
end)

Last updated