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

Create a one-time order

Discussion in 'Development' started by Matrox, Aug 17, 2018.

  1. Matrox

    Matrox Slime

    Messages:
    92
    GitHub:
    MatroxMC
    Hello I would like to make a plugin or when we do the command /test for example and low it shows us a message but how to make it usable only once.
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Assuming you mean one time forever, when the player runs the command, save their name to a file and check if their name exists in that file before executing the command's code.
    pseudocode:
    Code:
     if(isset(config, name)) 
     return;
    else{ 
     your code
     config->set(players)[] = name
     config->save
    
     
    jasonwynn10 likes this.
  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.