Buenas ocupo una pequeña ayuda tengo este script, la pregunta es la siguiente lo uso en un server dayz pero el problema es que el contador no se reinicia a 0 cuando el ping se normaliza por ratos, sino que el contador sigue osea si me da 2 alertas de ping algo y pasan unos 5 minutos y me vuelve a subir el ping el contador continua en 2. Quisiera que por ejemplo se reinicie a los 30 segundos o asi cuando ping se normaliza.
gracias.
local warningCount = 10
local maxPing = 600
function killMyPing (thePlayer)
triggerClientEvent ( thePlayer, "ping.killPing", getRootElement())
outputChatBox("Your ping has been killed. You now can't be kicked for high ping.",thePlayer,0,255,0)
end
addCommandHandler("killmyping",killMyPing,true)
function onPingHighServer()
local warnings = getElementData(source,"warnings")
if not warnings then setElementData(source,"warnings",1) warnings = 1 end
if warnings < warningCount then setElementData(source,"warnings",warnings+1) outputChatBox("Warning: High ping detected! Your warnings: "..warnings,source,255,0,0)
outputDebugString("High ping for "..getPlayerName(source))
else
outputChatBox("#ff6464* #ffffff"..getPlayerName(source).."#ff6464 has got kicked for high ping.",root,255,0,0,true)
kickPlayer(source,source,"You got big ping (over "..maxPing..") "..warningCount.." times")
end
end
addEvent( "ping.onBigPing", true )
addEventHandler( "ping.onBigPing", getRootElement(), onPingHighServer )