You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 10, 2020. It is now read-only.
Hi there,
Not sure if this would be useful for you but could some sort of auto ban go out if there are X explosions by someone? Code for example can be:
recentExplosions = {}
AddEventHandler('explosionEvent', function(sender, ev)
if Components.Explosions and ev.damageScale ~= 0.0 and ev.ownerNetId == 0 then -- make sure component is enabled, damage isnt 0 and owner is the sender
ev.time = os.time()
table.insert(recentExplosions, {sender = sender, data=ev})
end
end)
end)
Citizen.CreateThread(function()
while true do
Wait(2000)
clientExplosionCount = {}
for i, expl in ipairs(recentExplosions) do
if not clientExplosionCount[expl.sender] then clientExplosionCount[expl.sender] = 0 end
clientExplosionCount[expl.sender] = clientExplosionCount[expl.sender]+1
table.remove(recentExplosions,i)
end
recentExplosions = {}
for c, count in pairs(clientExplosionCount) do
if count > 5 then
local license, steam = GetPlayerNeededIdentifiers(c)
local name = GetPlayerName(c)
(SEND AUTO BAN FUNCTION HERE)
end
end
end
end)
Hi there,
Not sure if this would be useful for you but could some sort of auto ban go out if there are X explosions by someone? Code for example can be: