Thread: help with event manager

Results 1 to 2 of 2
  1. #1 help with event manager 
    Banned
    Join Date
    Oct 2008
    Posts
    128
    Thanks given
    1
    Thanks received
    2
    Rep Power
    0
    well, i would like some help about event manager

    imagine i want the server to send a message to the player when hes in a certain area every 50 secs

    in process i would add
    if(isinpest && pctimz == 1)
    sendMessage("You are currently in pest control");
    if(pctimz > 0)
    pctimz--;
    ok, but when i want to do it with eventmanager

    i do
    EventManager.getSingleton().addEvent(
    new Event() {
    public void execute(EventContainer C) {
    if(isinpest)
    sendMessage("You are currently in pest control");
    // C.stop(); // stops the event from running
    }
    }, 50000);
    }
    but,, how should i put that??? in process???

    help plz
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2009
    Posts
    525
    Thanks given
    1
    Thanks received
    8
    Rep Power
    29
    Umm ok let's see. If the process is at 5000 miliseconds, this would work. Asuimg the pctimz isn't used for anything special.

    if(isinpest && pctimz >= 1)
    pctimz -=1;
    }
    if(isinpest &&pctimz == 0)
    sendMessage("You are currently in pest control");
    pctimz == 10;
    }
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •