Stuck on the logical order of how to do a command check timer.

Discussion in 'Plugin Development' started by dxwarlock, Jun 17, 2012.

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

    dxwarlock

    I know there is no way to block nodus, premium, etc etc.
    But ive noticed with regularity that quite a few mod clients send /plugin or /pl directly after login..and on a timed interval of about 3 seconds.

    So Im trying to find a way to catch this, I know it wont stop the clients most of the time, and isnt a real 'solution' to the problem. But if I can kick people doing it with a message of "use normal MC client".

    The issue I'm stuck on is I can get the command they send no problem, and make the scheduled task no problem, and even set an int to count how often they do it...
    But I cant think of how to order/code the OnPlayerCommand to have it catch each time they do the command using my scheduled task to say "after 5 in X seconds, kick" or "if /pl is sent withing 1 second of login, kick"

    So i got the basics of what parts I need to use (onlogin/onplayercommand/some int to count the times sent/scheduler to tick it all), just not how to put them together to achieve this.
     
  2. Offline

    ZeusAllMighty11

    If it's new users on their first login, you could do something like:
    -New user logging in (event)
    -If that NEW user types command : / plugin
    Kick user.
     
  3. pshedocode:
    Code:
    on every command:
      if(player.getLastPlayed() + (5*1000) > System.timeMilies())
        if command == /pl
          cancel command and kick player
    no need to use schedulars whit the /pl check
     
  4. Offline

    dxwarlock

    oh wow, I didnt know about "getlastplayed" thats 100x easier than my idea.
     
Thread Status:
Not open for further replies.

Share This Page