1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

I need help with a plugin

Discussion in 'Plugin Help' started by Hectman, Jul 4, 2020.

  1. Hectman

    Hectman Silverfish

    Messages:
    16
    Could someone who has knowledge in creating plugins help me creating a plugin?

    How I want it:

    I want a command (/n) that when typing with the following format (/n doubt) appears in the chat of all the players as a doubt in which everyone can answer I also want to have a limit of using the command, every 3 minutes you can put a doubt
     
  2. hexmor

    hexmor Baby Zombie

    Messages:
    110
    GitHub:
    h3xmor
    explain more
     
  3. Hectman

    Hectman Silverfish

    Messages:
    16
    What I mean is a doubt channel in which everyone can participate, I want the player to use /n to post their question, I also want it to appear in everyone's chat log with blue letters Example:

    /n how do i crawl a peak?

    by entering this will appear in everyone's chat log

    I'm going to see if I can give you a more advanced example haha I'm not that good with this
     
  4. JviguyGamesYT

    JviguyGamesYT Baby Zombie

    Messages:
    113
    GitHub:
    jviguy
    so u basically need a command that broadcasts a message in blue and has a task holding a delay for the /n command?
     
  5. Hectman

    Hectman Silverfish

    Messages:
    16
    Something like that, that it is a channel of doubts in which they post a question and other players can answer that question also that every 2 minutes they can post a question.
     
  6. JviguyGamesYT

    JviguyGamesYT Baby Zombie

    Messages:
    113
    GitHub:
    jviguy
    ok i could probs do that just give me atleast two days im working on a few projects at once right now.
     
  7. Hectman

    Hectman Silverfish

    Messages:
    16
  8. Primus

    Primus Zombie Pigman

    Messages:
    749
    Avoid using Tasks where not necessary.
    PHP:
    // Command executed
    this.cache[player.name] = time();

    func get_last_execution_time(Player player) {
       return 
    this.cache[player.name] ?? 0;
    }

    delta time() - get_last_execution_time(player);

    // Check if three minutes passed
    if(delta three_minutes) {
       
    // Execute command, update cache
    }
    For anyone who's confused - this is Pseudocode
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.