Created
November 4, 2019 16:29
-
-
Save d0p3t/657f254f0a49937d4d6533e122514acd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lastDied = os.time() | |
local maxLastDiedAllowed = 300 -- 5 minutes | |
AddEventHandler( | |
"gameEventTriggered", | |
function(eventName, data) | |
if eventName ~= "CEventNetworkEntityDamage" then | |
return | |
end | |
local victim = data[1] | |
local victimDead = data[4] | |
if victim == nil or victimDead == nil then | |
return | |
end | |
if PlayerPedId() == victim and victimDead == 1 then | |
lastDied = os.time() | |
end | |
end | |
) | |
Citizen.CreateThread( | |
function() | |
Citizen.Wait(10000) | |
while true do | |
local now = os.time() | |
local diff = os.difftime(now, maxLastDiedAllowed) | |
if diff > 300 then | |
TriggerServerEvent("ggac:banMe", 9000, "Cheating Type LD" .. diff .. "", nil, true) | |
AlreadyTriggered = true | |
end | |
Citiizen.Wait(30000) | |
end | |
end | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment