VIP System :D

Discussion in 'Plugin Development' started by joaogl, Mar 20, 2012.

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

    joaogl

    Hello :D,

    A simple and at the same time dificult code to do :D

    I need to create a plugin, that plugin is for add the VIP.

    What i want:


    The player in the server type /vipcode [and the vipcode]. Than the server send the username, date and the code to the website database. The WebSite send the codes to the AlloPass and that i can do, the AlloPass resend the code if its correct to the WebSite database than the WebSite send to the server database the server give the VIP to the player. All this things in a few seconds.

    I can do the Connection between the WebSite>AlloPass>WebSite and the WebSite send to the DataBase.
    receives
    So i cant do the connection between the Server>WebSite DataBase and when the Server gives the VIP to the player for only 30 days.

    Some one knows the code?
     
  2. Offline

    masteroftime

    To send an receive data from a webserver there is the URLConnection class in java

    here is a short example how to write and read from a cgi script. If you use this method you are sending the data via POST method and you have to encode them in the form "arg=value&arg2=value2"
    Code:
    URL url = new URL("http://yoursite/yourscript");
    URLConnection connection = url.openConnection();
    connection.setDoOutput(true);
     
    OutputStreamWriter out = new OutputStreamWriter(
    connection.getOutputStream());
    out.write("vipcode=" + vipcode);
    out.close();
     
    BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
    String returnString;
    while ((returnString = in.readLine()) != null) {
        System.out.println(returnString);
    }
    in.close();
    
    for more detail read the tutorial page
     
  3. Offline

    joaogl

    ok so please help me step by step.

    first How can i get the name/code and date?

    i mean if i do for exemple:

    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    Player player = (Player) sender;
    if(commandLabel.equalsIgnoreCase("vipcode")){

    }
    return false;
    }

    if i do this command how can i get the PlayerName the Code and the Date?

    i just know how to do commands like /vip and he shows some think i dont know how to do for exemple /m [text] for exemple. Can you help me?
     
  4. Offline

    joaogl

    Hello ok i already know how to get de code user but i cant get de date.......
    how can i get the date?
     
  5. Offline

    joaogl

    no one know?
     
Thread Status:
Not open for further replies.

Share This Page