Help with player events

Discussion in 'Plugin Development' started by gaz492, Apr 27, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    gaz492

    Ok back with the old api this code worked for player events
    Code:
        pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, this.playerListener, Event.Priority.Low, this);
        pm.registerEvent(Event.Type.PLAYER_CHAT, this.playerListener, Event.Priority.Low, this);
    but with the new api it does not. this is the only issue i have with my current code i have managed to get everything else to work. i just need this one bit coded in the new api and i can alpha my plugin

    Il post the source code if need be
     
  2. Offline

    Iron_Crystal

    Define the class like this:\

    Code:
        public final PLAYER_COMMAND PLAYER_COMMAND = new PLAYER_COMMAND(this);
    
    and register it like this:

    Code:
            pm.registerEvents(this.PLAYER_COMMAND, this);
    
     
  3. Offline

    gaz492

    Didnt seem to work
     
  4. Offline

    Iron_Crystal

    Whats the problem? Is there a syntax error?

    Please post your updated code.
     
  5. You're still using the old event system, take a look here: New Event System
     
Thread Status:
Not open for further replies.

Share This Page