Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.91 KB | None | 0 0
  1. --[[
  2. ## SCRIPT BY: Pedriinz ##
  3. ## CONTACT SKYPE: pedrosz4 ##
  4. ]]
  5.  
  6. function onKill(cid, target)
  7.     local random = math.random(ANTI_BOT_SYSTEM.config.minMonstersToCheck, ANTI_BOT_SYSTEM.config.maxMonstersToCheck)
  8.  
  9.     if not isMonster(target) then
  10.         return true
  11.     end
  12.  
  13.     if isInArray(ANTI_BOT_SYSTEM.config.monstersForNotCheck, getCreatureName(target):lower()) then
  14.         --print(getCreatureName(target):lower())
  15.         return true
  16.     end
  17.  
  18.     if not ANTI_BOT_SYSTEM.cache.players[cid] then
  19.         ANTI_BOT_SYSTEM.cache.players[cid] = {count = 1, verified = "false"}
  20.     else
  21.         if ANTI_BOT_SYSTEM.cache.players[cid].count >= random and ANTI_BOT_SYSTEM.cache.players[cid].verified == "false" then
  22.             ANTI_BOT_SYSTEM.cache.players[cid] = {count = math.max(ANTI_BOT_SYSTEM.cache.players[cid].count), verified = "true"}
  23.             doSendMagicEffect(getCreaturePosition(cid), 56)
  24.             doSendAnimatedText(getCreaturePosition(cid), "Attention!", math.random(1, 255))
  25.             doPlayerSendTextMessage(cid, ANTI_BOT_SYSTEM.messages.channel_enter.type, string.format(ANTI_BOT_SYSTEM.messages.channel_enter.msg, ANTI_BOT_SYSTEM.config.timeToAnswer))
  26.             addEvent(function(cid)
  27.                 if not isPlayer(cid) then
  28.                     return
  29.                 end
  30.                 local random = math.random(#ANTI_BOT_SYSTEM.questions)
  31.                 doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, ANTI_BOT_SYSTEM.questions[random].question)
  32.                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Use o comando !antibot xxx para responder a verificação!")
  33.                 ANTI_BOT_SYSTEM.cache.question = random
  34.             end, 2000, cid)
  35.             addEvent(vericationBot, ANTI_BOT_SYSTEM.config.timeToAnswer * 1000, cid)  
  36.         elseif ANTI_BOT_SYSTEM.cache.players[cid].count < random and ANTI_BOT_SYSTEM.cache.players[cid].verified == "false" then
  37.             ANTI_BOT_SYSTEM.cache.players[cid] = {count = math.max(ANTI_BOT_SYSTEM.cache.players[cid].count) + 1, verified = "false"}
  38.         end
  39.     end
  40.  
  41.     return true
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement