Ir para conteúdo
  • 0

[Pedido] Anti Bot


felipejf

Pergunta

Tipo do script: Anti Bot

Protocolo (versão do Tibia): 8.6

Servidor utilizado: TFS (trunk.r3884)

Nível de experiência: Não sei

Adicionais/Informações:

Funcionamento: o sistema irá manda uma mensagem para o player e o player tera que responder a mensagem usando um comando.

Exemplo:

 

Mensagem enviada:

Qual é o resultado de 10 + 10?

Usando os números de forma aleatoria

Resposta:

!r 20

Comando usado pelo player para responder a mensagem.

 

Caso o player não responda a mensagem dentro de 2 minutos, será setado uma warning para ele.

 

Execução do script:

Será executado a cada 2 horas.

Link para o comentário
Compartilhar em outros sites

14 respostass a esta questão

Posts Recomendados

  • 0

em talkactions cria um arquivo antibot e coloca iso dentro

 

function onSay(cid, words, param, channel)

if getPlayerAccess(cid) > 3 then

return false

elseif getPlayerStorageValue(cid,9564) == -1 then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Você ainda não recebeu um novo número de confirmação anti-bot.')

elseif tonumber(param) == getPlayerStorageValue(cid,9564) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Confirmado com sucesso. Bom jogo.')

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Antha anti-bot system.')

setPlayerStorageValue(cid,9564,-1)

setPlayerStorageValue(cid,9565,-1)

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING,'Número de confirmação errado. O seu número de confirmação é '..getPlayerStorageValue(cid,9564)..'.')

end

return true

end

 

<talkaction words="!confirmbot" script="antibot.lua"/>

 

 

em globalevents cria um arquivo botter e adciona iso dentro

 

function onThink(interval, lastExecution)

for x=1,#getOnlinePlayers() do

if getPlayerAccess(getCreatureByName(getOnlinePlayers()[x])) < 4 and (not isPlayerPzLocked(getCreatureByName(getOnlinePlayers()[x]))) and getOnlinePlayers()[x] ~= "Account Manager" then

if getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9564) == -1 then

local numero = math.random(0,99999)

doPlayerSendTextMessage(getCreatureByName(getOnlinePlayers()[x]), MESSAGE_STATUS_WARNING, 'Anti-bot . Seu número de confirmação anti-bot é: '..numero..'. Por favor digite !confirmbot XXXXX onde XXXXX é seu número de confirmação.')

setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9564,numero)

elseif getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565) == -1 then

setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565,1)

doPlayerSendTextMessage(getCreatureByName(getOnlinePlayers()[x]), MESSAGE_STATUS_WARNING, 'Último aviso. Confirme seu número gerado pelo sistema anti-bot pelo comando !confirmbot ou você será banido.')

elseif getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565) == 1 then

doAddAccountBanishment(getAccountIdByName(getOnlinePlayers()[x]))

setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565,-1)

doRemoveCreature(getCreatureByName(getOnlinePlayers()[x]))

end

end

end

return TRUE

end

 

<globalevent name="booting" interval="60" script="botter.lua"/>

 

voce so edita o interval nao sei quantos seg e 2 hora

Editado por Zmovir
Link para o comentário
Compartilhar em outros sites

  • 0

Testado e funcionando perfeitamente.

So gostaria de saber se é possivel ao inves de banir toda a conta, banir somente o player que não respodeu a mensagem?

Obrigado,

Felipe.

Link para o comentário
Compartilhar em outros sites

  • 0
function onThink(interval, lastExecution)

for x=1,#getOnlinePlayers() do

if getPlayerAccess(getCreatureByName(getOnlinePlayers()[x])) < 4 and (not isPlayerPzLocked(getCreatureByName(getOnlinePlayers()[x]))) and getOnlinePlayers()[x] ~= "Account Manager" then

if getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9564) == -1 then

local numero = math.random(0,99999)

doPlayerSendTextMessage(getCreatureByName(getOnlinePlayers()[x]), MESSAGE_STATUS_WARNING, 'Anti-bot . Seu número de confirmação anti-bot é: '..numero..'. Por favor digite !confirmbot XXXXX onde XXXXX é seu número de confirmação.')

setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9564,numero)

elseif getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565) == -1 then

setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565,1)

doPlayerSendTextMessage(getCreatureByName(getOnlinePlayers()[x]), MESSAGE_STATUS_WARNING, 'Último aviso. Confirme seu número gerado pelo sistema anti-bot pelo comando !confirmbot ou você será banido.')

elseif getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565) == 1 then

doAddPlayerBanishment(getPlayerIdByName(getOnlinePlayers()[x]))

setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565,-1)

doRemoveCreature(getCreatureByName(getOnlinePlayers()[x]))

end

end

end

return TRUE

end

 

 

nao testei

Link para o comentário
Compartilhar em outros sites

  • 0

Eu tenho esse mod aqui, mas nunca testei

<?xml version="1.0" encoding="UTF-8"?>
<mod name="AntiBot System" version="5.0" author="Karpio" contact="http://tibia.net.pl/members/karpio.html" enabled="yes">
    <config name="check_system"><![CDATA[
		    config = {
				    code = 999,
				    ptime = 998,
				    ttime = 997,
				    nick = false,
				    afk = true,
				    afks = 38417,
				    lvl = 60,
				    nologout = true,
				    guild = true,
				    distance = 10
				    }
		    afk = {
				    time = 3, -- Seconds
				    say_events = {}
				    }
		    function randomCode()
				    return math.random(1000, 9999)
		    end

		    function SayText(cid)
				    if isPlayer(cid) == TRUE then
							 if afk.say_events[getPlayerGUID(cid)] ~= nil then
									 if isPlayer(cid) == TRUE then
											 doSendAnimatedText(getPlayerPosition(cid),"AFK", math.random(01,255))
									 end
									 afk.say_events[getPlayerGUID(cid)] = addEvent(SayText, afk.time * 1000 / 2, cid)	 
							 end													 
				    end
				    return TRUE
		    end
		    function czas(timeDiff)
		    local dateFormat = {
				    {"day", timeDiff / 60 / 60 / 24},
				    {"hour", timeDiff / 60 / 60 % 24},
				    {"minute", timeDiff / 60 % 60},
				    {"second", timeDiff % 60}
		    }
		    local out = {}
		    for k, t in ipairs(dateFormat) do
				    local v = math.floor(t[2])
				    if(v > 60) then
						    table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
				    elseif(v > 0) then
						    table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or '') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
				    end
		    end   
		    return table.concat(out)
    end 

    function check(cid, target)
		    local code = randomCode()
		    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You check "..getCreatureName(target)..".")
		    doPlayerSendTextMessage(target, MESSAGE_STATUS_WARNING, "[AntiBot]: "..(config.nick == true and getCreatureName(cid) or "Someone").." check you. You must write /check "..code.." if you don't want be banished. You have only 15 minutes.")
		    setPlayerStorageValue(target, config.code, code)
		    setPlayerStorageValue(target, config.ttime, os.time() + (3 * 60 * 60))
		    setPlayerStorageValue(cid, config.ptime, os.time() + (6 * 60 * 60))
		    addEvent(function()
				    if(isPlayer(target) == false) then
						    return false
				    elseif(getPlayerStorageValue(target, config.code) == 0) then
						    return false
				    end
				    doPlayerSendTextMessage(target, MESSAGE_STATUS_WARNING, "[AntiBot]: You have only 1 minute. Please write /check "..getPlayerStorageValue(target, config.code)..".")
				    addEvent(function()
						    if(isPlayer(target) == false) then
								    return false
						    elseif(getPlayerStorageValue(target, config.code) == 0) then
								    return false
						    end
						    doAddAccountBanishment(getPlayerAccountId(target), target, os.time() + 48 * 3600, 12, 2, 'Banished by AntiBot System by Karpio', 0)
						    doRemoveCreature(target)
				    end, 60 * 1000, {target = target, config = config})
		    end, 14 * 60 * 1000, {target = target, config = config, cid = cid})
    end

    function antibotGuildChange(cid, type)
		    if(type == "on") then
				    db.executeQuery("UPDATE guilds SET checkbot=1 WHERE id="..getPlayerGuildId(cid).." LIMIT 1;")
				    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Now members of your guild can't check players from them.")
		    elseif(type == "off") then					
				    db.executeQuery("UPDATE guilds SET checkbot=0 WHERE id="..getPlayerGuildId(cid).." LIMIT 1;")
				    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Now members of your guild can check players from them.")
		    end
		    return true
    end

    function antibotGuildCheck(cid, target)
		    if(getPlayerGuildId(cid) == 0) then
				    return true
		    elseif(getPlayerGuildId(target) == 0) then
				    return true
		    elseif(getPlayerGuildId(target) ~= getPlayerGuildId(cid)) then
				    return true
		    end
		    local result = db.getResult("SELECT * FROM guilds WHERE id="..getPlayerGuildId(cid).." LIMIT 1;")
		    if(result:getDataInt("checkbot") == 1) then
				    return false
		    else
				    return true
		    end
    end

    ]]></config>
    <talkaction words="/check" event="buffer"><![CDATA[
		    domodlib('check_system')
				    local t = string.explode(param, ",")
				    if(param == "") then
						    return doPlayerPopupFYI(cid, "Welcome in AntiBot Information.\nScript author: Karpio\nScript Version: 1.1\n\nMini tutorial:\n/check nick - if you want check player with name nick\n/check code - if someone check you\n\nYou can check next player "..((getPlayerStorageValue(cid, config.ptime) - os.time()) > 0 and "after "..czas(getPlayerStorageValue(cid, config.ptime) - os.time()) or "now")..".\nYou can be check "..((getPlayerStorageValue(cid, config.ttime) - os.time()) > 0 and "after "..czas(getPlayerStorageValue(cid, config.ttime) - os.time()) or "now")..".")
				    elseif(t[1] == "guild") then
						    if(config.guild == false) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not use this function.")
						    elseif(not t[2]) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Use it /check guild, on/off.")
						    elseif(t[2] == "on" and getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER) then
								    return antibotGuildChange(cid, "on")
						    elseif(t[2] == "off" and getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER) then
								    return antibotGuildChange(cid, "off")
						    else
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Invalid param or you aren't leader.")
						    end
				    elseif(isNumber(param) == true) then
						    if(getPlayerStorageValue(cid, config.code) < 1) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: If you want check code, you must be checked by other player.")
						    elseif(getPlayerStorageValue(cid, config.code) ~= tonumber(param)) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Invalid code.")
						    end
						    setPlayerStorageValue(cid, config.code, 0)
						    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Code is correct.")
						    return true
				    else
						    if(getPlayerByNameWildcard(param) == nil) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Target not found.")
						    elseif(getPlayerByNameWildcard(param) == tonumber(cid)) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check yourself.")
						    elseif(getTileInfo(getCreaturePosition(cid)).protection == true) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check players if you are in protection zone.")
						    elseif(isNumber(config.lvl) and getPlayerLevel(cid) < config.lvl) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not use this system if your level is lover that "..config.lvl..".")
						    elseif(getTileInfo(getCreaturePosition(getPlayerByNameWildcard(param))).protection == true) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this players, because "..(getPlayerSex(getPlayerByNameWildcard(param)) == 0 and "she" or "he").." is in protection zone.")
						    elseif(config.afk and getPlayerStorageValue(cid, config.afks) > 0) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check players if you are afk.")
						    elseif(config.afk and getPlayerStorageValue(getPlayerByNameWildcard(param), config.afks) > 0) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this players, because "..(getPlayerSex(getPlayerByNameWildcard(param)) == 0 and "she" or "he").." is afk.")
						    elseif(getPlayerStorageValue(cid, config.ptime) > os.time()) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You must rest if you want check next player.")
						    elseif(getPlayerStorageValue(getPlayerByNameWildcard(param), config.ttime) > os.time()) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this player.")
						    elseif((getTileInfo(getCreaturePosition(cid)).nologout or getTileInfo(getCreaturePosition(getPlayerByNameWildcard(param))).nologout) and config.nologout == true) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this player.")
						    elseif(antibotGuildCheck(cid, getPlayerByNameWildcard(param)) == false and config.guild) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this player.")
						    elseif(getDistanceBetween(getCreaturePosition(cid, getCreaturePosition(getPlayerByNameWildcard(param)) > config.distance or config.distance == 0) then
								    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this player.")
						    end
						    check(cid, getPlayerByNameWildcard(param))			
				    end
				    ]]></talkaction>
    <event type="combat" name="AFK_Protection" event="script"><![CDATA[
		    domodlib('check_system')
		    function onCombat(cid, target)
		    if(isPlayer(target) == true) then
				    if(getPlayerStorageValue(target, config.afks) == 1) then
						    return false
				    end
		    end
		    return true
		    end]]></event>
    <event type="login" name="AFK_Login" event="script"><![CDATA[
		    domodlib('check_system')
		    function onLogin(cid)
		    if(getPlayerStorageValue(cid, config.afks) > 0) then
				    setPlayerStorageValue(cid, config.afks, 0)
		    end
		    registerCreatureEvent(cid, "AFK_Protection")
		    registerCreatureEvent(cid, "AFK_Login")
		    registerCreatureEvent(cid, "AFK_Logout")
		    return true
		    end]]></event>
    <event type="logout" name="AFK_Logout" event="script"><![CDATA[
		    domodlib('check_system')	  
		    function onLogout(cid)
		    if(getPlayerStorageValue(cid, config.afks) == 1) then
				    return false
		    end
		    return true
		    end]]></event>

    <talkaction words="!afk" event="buffer"><![CDATA[
    domodlib('check_system')
    afkCheck = getPlayerStorageValue(cid, config.afks)
 if (param == "on") then
		    if(getCreatureCondition(cid, CONDITION_INFIGHT) == true) then
				    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are infight.")
		    end
    if (afkCheck == -1) then
	    if (isPlayer(cid) == TRUE) then
		    doSendAnimatedText(getPlayerPosition(cid),"AFK", math.random(01,255))
	    end
	    afk.say_events[getPlayerGUID(cid)] = addEvent(SayText, afk.time * 1000, cid)
	    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Agora voce esta AFK.")
	    doCreatureSetNoMove(cid, true)
	    setPlayerStorageValue(cid, config.afks, 1)
    else
	    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ja esta AFK.")
    end
 elseif (param == "off") then
    stopEvent(afk.say_events[getPlayerGUID(cid)])
    afk.say_events[getPlayerGUID(cid)] = nil
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Bem Vindo de volta!")
    doCreatureSetNoMove(cid, false)
    setPlayerStorageValue(cid, config.afks, -1)
    else
		    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
   end
    ]]></talkaction>
</mod>

Link para o comentário
Compartilhar em outros sites

  • 0

Eu tenho esse mod aqui, mas nunca testei

<?xml version="1.0" encoding="UTF-8"?>
<mod name="AntiBot System" version="5.0" author="Karpio" contact="http://tibia.net.pl/members/karpio.html" enabled="yes">
	<config name="check_system"><![CDATA[
			config = {
					code = 999,
					ptime = 998,
					ttime = 997,
					nick = false,
					afk = true,
					afks = 38417,
					lvl = 60,
					nologout = true,
					guild = true,
					distance = 10
					}
			afk = {
					time = 3, -- Seconds
					say_events = {}
					}
			function randomCode()
					return math.random(1000, 9999)
			end

			function SayText(cid)
					if isPlayer(cid) == TRUE then
							 if afk.say_events[getPlayerGUID(cid)] ~= nil then
									 if isPlayer(cid) == TRUE then
											 doSendAnimatedText(getPlayerPosition(cid),"AFK", math.random(01,255))
									 end
									 afk.say_events[getPlayerGUID(cid)] = addEvent(SayText, afk.time * 1000 / 2, cid)	
							 end													
					end
					return TRUE
			end
			function czas(timeDiff)
			local dateFormat = {
					{"day", timeDiff / 60 / 60 / 24},
					{"hour", timeDiff / 60 / 60 % 24},
					{"minute", timeDiff / 60 % 60},
					{"second", timeDiff % 60}
			}
			local out = {}
			for k, t in ipairs(dateFormat) do
					local v = math.floor(t[2])
					if(v > 60) then
							table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
					elseif(v > 0) then
							table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or '') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
					end
			end  
			return table.concat(out)
	end

	function check(cid, target)
			local code = randomCode()
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You check "..getCreatureName(target)..".")
			doPlayerSendTextMessage(target, MESSAGE_STATUS_WARNING, "[AntiBot]: "..(config.nick == true and getCreatureName(cid) or "Someone").." check you. You must write /check "..code.." if you don't want be banished. You have only 15 minutes.")
			setPlayerStorageValue(target, config.code, code)
			setPlayerStorageValue(target, config.ttime, os.time() + (3 * 60 * 60))
			setPlayerStorageValue(cid, config.ptime, os.time() + (6 * 60 * 60))
			addEvent(function()
					if(isPlayer(target) == false) then
							return false
					elseif(getPlayerStorageValue(target, config.code) == 0) then
							return false
					end
					doPlayerSendTextMessage(target, MESSAGE_STATUS_WARNING, "[AntiBot]: You have only 1 minute. Please write /check "..getPlayerStorageValue(target, config.code)..".")
					addEvent(function()
							if(isPlayer(target) == false) then
									return false
							elseif(getPlayerStorageValue(target, config.code) == 0) then
									return false
							end
							doAddAccountBanishment(getPlayerAccountId(target), target, os.time() + 48 * 3600, 12, 2, 'Banished by AntiBot System by Karpio', 0)
							doRemoveCreature(target)
					end, 60 * 1000, {target = target, config = config})
			end, 14 * 60 * 1000, {target = target, config = config, cid = cid})
	end

	function antibotGuildChange(cid, type)
			if(type == "on") then
					db.executeQuery("UPDATE guilds SET checkbot=1 WHERE id="..getPlayerGuildId(cid).." LIMIT 1;")
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Now members of your guild can't check players from them.")
			elseif(type == "off") then					
					db.executeQuery("UPDATE guilds SET checkbot=0 WHERE id="..getPlayerGuildId(cid).." LIMIT 1;")
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Now members of your guild can check players from them.")
			end
			return true
	end

	function antibotGuildCheck(cid, target)
			if(getPlayerGuildId(cid) == 0) then
					return true
			elseif(getPlayerGuildId(target) == 0) then
					return true
			elseif(getPlayerGuildId(target) ~= getPlayerGuildId(cid)) then
					return true
			end
			local result = db.getResult("SELECT * FROM guilds WHERE id="..getPlayerGuildId(cid).." LIMIT 1;")
			if(result:getDataInt("checkbot") == 1) then
					return false
			else
					return true
			end
	end

	]]></config>
	<talkaction words="/check" event="buffer"><![CDATA[
			domodlib('check_system')
					local t = string.explode(param, ",")
					if(param == "") then
							return doPlayerPopupFYI(cid, "Welcome in AntiBot Information.\nScript author: Karpio\nScript Version: 1.1\n\nMini tutorial:\n/check nick - if you want check player with name nick\n/check code - if someone check you\n\nYou can check next player "..((getPlayerStorageValue(cid, config.ptime) - os.time()) > 0 and "after "..czas(getPlayerStorageValue(cid, config.ptime) - os.time()) or "now")..".\nYou can be check "..((getPlayerStorageValue(cid, config.ttime) - os.time()) > 0 and "after "..czas(getPlayerStorageValue(cid, config.ttime) - os.time()) or "now")..".")
					elseif(t[1] == "guild") then
							if(config.guild == false) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not use this function.")
							elseif(not t[2]) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Use it /check guild, on/off.")
							elseif(t[2] == "on" and getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER) then
									return antibotGuildChange(cid, "on")
							elseif(t[2] == "off" and getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER) then
									return antibotGuildChange(cid, "off")
							else
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Invalid param or you aren't leader.")
							end
					elseif(isNumber(param) == true) then
							if(getPlayerStorageValue(cid, config.code) < 1) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: If you want check code, you must be checked by other player.")
							elseif(getPlayerStorageValue(cid, config.code) ~= tonumber(param)) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Invalid code.")
							end
							setPlayerStorageValue(cid, config.code, 0)
							doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Code is correct.")
							return true
					else
							if(getPlayerByNameWildcard(param) == nil) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Target not found.")
							elseif(getPlayerByNameWildcard(param) == tonumber(cid)) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check yourself.")
							elseif(getTileInfo(getCreaturePosition(cid)).protection == true) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check players if you are in protection zone.")
							elseif(isNumber(config.lvl) and getPlayerLevel(cid) < config.lvl) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not use this system if your level is lover that "..config.lvl..".")
							elseif(getTileInfo(getCreaturePosition(getPlayerByNameWildcard(param))).protection == true) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this players, because "..(getPlayerSex(getPlayerByNameWildcard(param)) == 0 and "she" or "he").." is in protection zone.")
							elseif(config.afk and getPlayerStorageValue(cid, config.afks) > 0) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check players if you are afk.")
							elseif(config.afk and getPlayerStorageValue(getPlayerByNameWildcard(param), config.afks) > 0) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this players, because "..(getPlayerSex(getPlayerByNameWildcard(param)) == 0 and "she" or "he").." is afk.")
							elseif(getPlayerStorageValue(cid, config.ptime) > os.time()) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You must rest if you want check next player.")
							elseif(getPlayerStorageValue(getPlayerByNameWildcard(param), config.ttime) > os.time()) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this player.")
							elseif((getTileInfo(getCreaturePosition(cid)).nologout or getTileInfo(getCreaturePosition(getPlayerByNameWildcard(param))).nologout) and config.nologout == true) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this player.")
							elseif(antibotGuildCheck(cid, getPlayerByNameWildcard(param)) == false and config.guild) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this player.")
							elseif(getDistanceBetween(getCreaturePosition(cid, getCreaturePosition(getPlayerByNameWildcard(param)) > config.distance or config.distance == 0) then
									return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this player.")
							end
							check(cid, getPlayerByNameWildcard(param))			
					end
					]]></talkaction>
	<event type="combat" name="AFK_Protection" event="script"><![CDATA[
			domodlib('check_system')
			function onCombat(cid, target)
			if(isPlayer(target) == true) then
					if(getPlayerStorageValue(target, config.afks) == 1) then
							return false
					end
			end
			return true
			end]]></event>
	<event type="login" name="AFK_Login" event="script"><![CDATA[
			domodlib('check_system')
			function onLogin(cid)
			if(getPlayerStorageValue(cid, config.afks) > 0) then
					setPlayerStorageValue(cid, config.afks, 0)
			end
			registerCreatureEvent(cid, "AFK_Protection")
			registerCreatureEvent(cid, "AFK_Login")
			registerCreatureEvent(cid, "AFK_Logout")
			return true
			end]]></event>
	<event type="logout" name="AFK_Logout" event="script"><![CDATA[
			domodlib('check_system')	  
			function onLogout(cid)
			if(getPlayerStorageValue(cid, config.afks) == 1) then
					return false
			end
			return true
			end]]></event>

	<talkaction words="!afk" event="buffer"><![CDATA[
	domodlib('check_system')
	afkCheck = getPlayerStorageValue(cid, config.afks)
 if (param == "on") then
			if(getCreatureCondition(cid, CONDITION_INFIGHT) == true) then
					return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are infight.")
			end
	if (afkCheck == -1) then
		if (isPlayer(cid) == TRUE) then
			doSendAnimatedText(getPlayerPosition(cid),"AFK", math.random(01,255))
		end
		afk.say_events[getPlayerGUID(cid)] = addEvent(SayText, afk.time * 1000, cid)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Agora voce esta AFK.")
		doCreatureSetNoMove(cid, true)
		setPlayerStorageValue(cid, config.afks, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ja esta AFK.")
	end
 elseif (param == "off") then
	stopEvent(afk.say_events[getPlayerGUID(cid)])
	afk.say_events[getPlayerGUID(cid)] = nil
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Bem Vindo de volta!")
	doCreatureSetNoMove(cid, false)
	setPlayerStorageValue(cid, config.afks, -1)
	else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
end
	]]></talkaction>
</mod>

 

 

Nao tem como bani player agora que lembrrei quando voce da ban no ot vc da ban na acc pra bani player e so namelocked que pode

Link para o comentário
Compartilhar em outros sites

  • 0

@Zmovir

 

Quer dizer que esse namelocked é aquele ban que obriga o player a trocar de nome?

 

Ou ele bani o player pelo nome?

Se não for nenhum dos dois, me explica como funciona esse namelocked.

 

Obrigado.

Editado por Felipejf
Link para o comentário
Compartilhar em outros sites

  • 0

Esse mod ae deu erro aqui.

 

E se o player tiver na área de treiner? Ele terá que responder também?

 

 

Me surgiu essas duvida do nada.

 

Podem fechar o tópico.

Editado por Felipejf
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...