Post by rafael on Oct 20, 2018 21:20:15 GMT -3
O script funciona da seguinte forma, quando alguém mata outra pessoa e os 2 tem o mesmo IP ele grava em characters.antifarm_system.
COMO USAR
Os 2 primeiros scripts e so voce colocar na pasta do ELUNA ENGINE.
O terceiro é só você executar no banco de dados characters.
COMANDOS
.antifarm ou .antifarm help PARA SABER OS COMANDOS DISPONIVEIS
.antifarm log PARA SABER QUEM ANDA FARMANDO KILL[/font]
.antifarm del (id) PARA DELETAR BASEADO NO ID. (EX: .antifarm del 8)
O id pode ser conseguindo dando ".antifarm log".
COMO USAR
Os 2 primeiros scripts e so voce colocar na pasta do ELUNA ENGINE.
O terceiro é só você executar no banco de dados characters.
COMANDOS
.antifarm ou .antifarm help PARA SABER OS COMANDOS DISPONIVEIS
.antifarm log PARA SABER QUEM ANDA FARMANDO KILL[/font]
.antifarm del (id) PARA DELETAR BASEADO NO ID. (EX: .antifarm del 8)
O id pode ser conseguindo dando ".antifarm log".
function CommandAFS(event, player, command)
if(player:IsGM() == true)then
if(command == "antifarm log")then
local resultado = CharDBQuery("SELECT * FROM antifarm_system order by ID asc ")
repeat
local id = resultado:GetString(0)
local matou = resultado:GetString(1)
local morreu = resultado:GetString(2)
local inbg = resultado:GetString(3)
local inarena = resultado:GetString(4)
if(inbg == "true")then
player:SendBroadcastMessage(id.." - O PLAYER "..matou.." MATOU "..morreu.." EM BG")
else
if(inarena == "true")then
player:SendBroadcastMessage(id.." - O PLAYER "..matou.." MATOU "..morreu.." EM ARENA")
else
player:SendBroadcastMessage(id.." - O PLAYER "..matou.." MATOU "..morreu.."")
end
end
until not resultado:NextRow()
end
local resultado = CharDBQuery("SELECT * FROM antifarm_system order by ID asc ")
repeat
local id = resultado:GetString(0)
if(command == "antifarm del "..id.."")then
CharDBExecute("DELETE FROM `antifarm_system` WHERE `ID`="..id..";")
player:SendBroadcastMessage("ID "..id.." excluido")
end
until not resultado:NextRow()
if(command == "antifarm" or command == "antifarm help")then
player:SendBroadcastMessage("DE .antifarm log PARA VER QUEM ANDA FARMANDO KILL.")
player:SendBroadcastMessage("DE .antifarm del (ID) PARA DELETAR USANDO UM ID.")
end
end
end
RegisterPlayerEvent(42, CommandAFS)
local function ANTIFARM(event, killer, killed)
killer:SendNotification("TENTATIVA DE FARM REGISTRADA")
local matador = killer:GetPlayerIP()
local morto = killed:GetPlayerIP()
if morto == matador then
if killer:InArena() == true then
CharDBExecute("INSERT INTO antifarm_system (`matou`, `morreu`, `inArena`) VALUES ('"..killer:GetName().."', '"..killed:GetName().."', 'true');")
else
if killer:InBattleground() == true then
CharDBExecute("INSERT INTO antifarm_system (`matou`, `morreu`, `inBG`) VALUES ('"..killer:GetName().."', '"..killed:GetName().."', 'true');")
end
if killer:InBattleground() == false and killer:InArena() == false then
CharDBExecute("INSERT INTO antifarm_system (`matou`, `morreu`) VALUES ('"..killer:GetName().."', '"..killed:GetName().."');")
end
end
end
end
RegisterPlayerEvent(6, ANTIFARM)
CREATE TABLE IF NOT EXISTS `antifarm_system` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`matou` varchar(50) NOT NULL,
`morreu` varchar(50) NOT NULL,
`InBG` varchar(50) DEFAULT NULL,
`InArena` varchar(50) DEFAULT NULL,
KEY `Index 1` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='SISTEMA ANTI FARM';
CREDITOS : RAFAEL R. M.