Author Topic: Log off do not work  (Read 2290 times)

0 Members and 1 Guest are viewing this topic.

Offline SilvaO

  • Member
  • ***
  • Posts: 43
  • Karma: +0/-0
Log off do not work
« on: 23 October, 2005, 23:07:44 »
Hi to all!

This is an IN/out user announce  LUA4

When user log in the script send a message

but when user log off the scrip does not send a massage.

I need help on this scrip please.


--Feito por nErBoS

sBot = "IN/out"

--## Usar Welcomes para os Nivies ##--

Reg = 1
Vip = 1
Operator = 1
Master = 1

--1 activa, 0 desactiva

--## Mensagens ##--

   --## Mensagens para REG ##--
   --## MSG de Entrada
   regwlcin = {
         "       RegUser ?? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar.",
         "       RegUser ? ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar."
   }
   --## MSG de Saida
   regwlcout = {
         "       RegUser  ?? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d Sair.",
         "       RegUser ? ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d Sair."
   }

   --## Mensagens para VIP ##--
   --## MSG de Entrada
   vipwlcin = {
         "       RegUser  ?? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar.",
         "       RegUser  ?? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar."
   }
   --## MSG de Saida
   vipwlcout = {
         "       RegUser   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d Sair.",
         "       RegUser   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d Sair."
   }

   --## Mensagens para OP ##--
   --## MSG de Entrada
   opwlcin = {
      "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar.",
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar."      
   }
   --## MSG de Saida
   opwlcout = {
      "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d sair.",
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d sair."      
   }

   --## Mensagens para MASTER ##--
   --## MSG de Entrada
   masterwlcin = {
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar.",
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d entrar."      
   }
   --## MSG de Saida
   masterwlcout = {
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d sair.",
         "     Operador   ? ? ? ? ? ? [USER] ? ? ? ? ? ?   akabou d sair."      
   }

function Main()
   frmHub:RegBot(sBot)
end

function NewUserConnected(user, data)
   if (user.iProfile == 3 and Reg == 1) then
      local regmsg = regwlcin[random(1, getn(regwlcin))]
      regmsg, x = gsub(regmsg, "%b[]", user.sName)
      SendToAll(sBot, regmsg)
   elseif (user.iProfile == 2 and Vip == 1) then
      local vipmsg = vipwlcin[random(1, getn(vipwlcin))]
      vipmsg, x = gsub(vipmsg, "%b[]", user.sName)
      SendToAll(sBot, vipmsg)
   elseif (user.iProfile == 0 and Operator == 1) then
      local mastermsg = masterwlcin[random(1, getn(masterwlcin))]
      mastermsg, x = gsub(mastermsg, "%b[]", user.sName)
      SendToAll(sBot, mastermsg)
   elseif (user.bOperator and Operator == 1) then
      local opmsg = opwlcin[random(1, getn(opwlcin))]
      opmsg, x = gsub(opmsg, "%b[]", user.sName)
      SendToAll(sBot, opmsg)
   end
end

OpConnected = NewUserConnected

function UserDisconnected(user, data)
   if (user.iProfile == 3 and Reg == 1) then
      local regmsg = regwlcout[random(1, getn(regwlcout))]
      regmsg, x = gsub(regmsg, "%b[]", user.sName)
      SendToAll(sBot, regmsg)
   elseif (user.iProfile == 2 and Vip == 1) then
      local vipmsg = vipwlcout[random(1, getn(vipwlcout))]
      vipmsg, x = gsub(vipmsg, "%b[]", user.sName)
      SendToAll(sBot, vipmsg)
   elseif (user.iProfile == 0 and Operator == 1) then
      local mastermsg = masterwlcout[random(1, getn(masterwlcout))]
      mastermsg, x = gsub(mastermsg, "%b[]", user.sName)
      SendToAll(sBot, mastermsg)
   elseif (user.bOperator and Operator == 1) then
      local opmsg = opwlcout[random(1, getn(opwlcout))]
      opmsg, x = gsub(opmsg, "%b[]", user.sName)
      SendToAll(sBot, opmsg)
   end
end

OpDisconnected = UserDisconne
« Last Edit: 23 October, 2005, 23:08:38 by SilvaO »

PtokaX forum

Log off do not work
« on: 23 October, 2005, 23:07:44 »

Offline Dessamator

  • Scripter
  • Emperor
  • ******
  • Posts: 1 262
  • Karma: +13/-9
(No subject)
« Reply #1 on: 23 October, 2005, 23:21:02 »
After a quick glance, I saw this error, its misspelled.
Code: [Select]
OpDisconnected = UserDisconne
Ignorance is Bliss.

Offline SilvaO

  • Member
  • ***
  • Posts: 43
  • Karma: +0/-0
(No subject)
« Reply #2 on: 23 October, 2005, 23:25:56 »
Do I have to remove that?

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 725
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #3 on: 23 October, 2005, 23:29:50 »
Code: [Select]
OpDisconnected = UserDisconnected
Everything could have been anything else and it would have just as much meaning.

Offline SilvaO

  • Member
  • ***
  • Posts: 43
  • Karma: +0/-0
(No subject)
« Reply #4 on: 24 October, 2005, 00:22:14 »
Thank you bastya_elvtars works 100%
« Last Edit: 24 October, 2005, 11:06:32 by SilvaO »

PtokaX forum

(No subject)
« Reply #4 on: 24 October, 2005, 00:22:14 »