Author Topic: multiple timers  (Read 1462 times)

0 Members and 1 Guest are viewing this topic.

Offline Jemte

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
multiple timers
« on: 22 January, 2005, 20:33:42 »
Code: [Select]
timer_reason = nil
user = nil

function NewUserConnected(curUser)
  user = curUser
  SetTimer(3000)
  if (curUser.sName==badname) then
     timer_reason = "msgbadnick"
     StartTimer()
  end
end

function OnTimer()
  if (timer_reason=="msgbadnick") then
    MsgBadNick()
  end
  if (timer_reason=="banbadnick") then
    BanBadNick()
  end
end

function MsgBadNick()
  StopTimer()

  SetTimer(30000)
  StartTimer()
  timer_reason = "banbadnick"
end

function BanBadNick()
  StopTimer()

  user:TimeBan(1)
end

the code just seems to run through everything in the OnTimer event even though i stopped the timer before i set and started it with the new time.
« Last Edit: 22 January, 2005, 20:35:52 by Jemte »

PtokaX forum

multiple timers
« on: 22 January, 2005, 20:33:42 »

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 744
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #1 on: 23 January, 2005, 14:27:48 »
Everything could have been anything else and it would have just as much meaning.

PtokaX forum

(No subject)
« Reply #1 on: 23 January, 2005, 14:27:48 »