Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- ## SCRIPT BY: Pedriinz ##
- ## CONTACT SKYPE: pedrosz4 ##
- ]]
- function onKill(cid, target)
- local random = math.random(ANTI_BOT_SYSTEM.config.minMonstersToCheck, ANTI_BOT_SYSTEM.config.maxMonstersToCheck)
- if not isMonster(target) then
- return true
- end
- if isInArray(ANTI_BOT_SYSTEM.config.monstersForNotCheck, getCreatureName(target):lower()) then
- --print(getCreatureName(target):lower())
- return true
- end
- if not ANTI_BOT_SYSTEM.cache.players[cid] then
- ANTI_BOT_SYSTEM.cache.players[cid] = {count = 1, verified = "false"}
- else
- if ANTI_BOT_SYSTEM.cache.players[cid].count >= random and ANTI_BOT_SYSTEM.cache.players[cid].verified == "false" then
- ANTI_BOT_SYSTEM.cache.players[cid] = {count = math.max(ANTI_BOT_SYSTEM.cache.players[cid].count), verified = "true"}
- doSendMagicEffect(getCreaturePosition(cid), 56)
- doSendAnimatedText(getCreaturePosition(cid), "Attention!", math.random(1, 255))
- doPlayerSendTextMessage(cid, ANTI_BOT_SYSTEM.messages.channel_enter.type, string.format(ANTI_BOT_SYSTEM.messages.channel_enter.msg, ANTI_BOT_SYSTEM.config.timeToAnswer))
- addEvent(function(cid)
- if not isPlayer(cid) then
- return
- end
- local random = math.random(#ANTI_BOT_SYSTEM.questions)
- doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, ANTI_BOT_SYSTEM.questions[random].question)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Use o comando !antibot xxx para responder a verificação!")
- ANTI_BOT_SYSTEM.cache.question = random
- end, 2000, cid)
- addEvent(vericationBot, ANTI_BOT_SYSTEM.config.timeToAnswer * 1000, cid)
- elseif ANTI_BOT_SYSTEM.cache.players[cid].count < random and ANTI_BOT_SYSTEM.cache.players[cid].verified == "false" then
- ANTI_BOT_SYSTEM.cache.players[cid] = {count = math.max(ANTI_BOT_SYSTEM.cache.players[cid].count) + 1, verified = "false"}
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement