Thread: Starter Command (with logs)

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Starter Command (with logs) 
    Respected Pr0ud Dad

    Systəx's Avatar
    Join Date
    Jun 2007
    Age
    40
    Posts
    245
    Thanks given
    1
    Thanks received
    0
    Rep Power
    279
    Object: To make a :tarter Command (with logs for those who try to cheat)
    Difficulty: 1/10 rlly easy
    Asumed knowledge: Copy and Paste

    Step one: Add this to your commands

    if (command.startsWith("starter")){
    if(kitstarter >= 1)
    {
    PlayerHandler.messageToAll = (playerName + " Is a ....ing n00bie who just got themself a black mark");
    disconnected = true;
    //
    BufferedWriter bw = null;
    try {
    bw = new BufferedWriter(new FileWriter("logs/blackmarks.txt", true));
    bw.write(playerName+" Tryed to Cheat, black mark! ");
    bw.newLine();
    bw.flush();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    } finally {
    if (bw != null) try {
    bw.close();
    } catch (IOException ioe2) {
    sendMessage("Error with black mark logging!");
    }
    }
    //
    }
    else if(kitstarter <= 0){

    kitstarter +=1;
    BufferedWriter bw = null;

    PlayerHandler.messageToAll = (playerName + " Got their starter kit get your's by typing :tarter");
    addItem(995,10000000);

    try {
    bw = new BufferedWriter(new FileWriter("logs/starters.txt", true));
    bw.write(playerName+" Got their starter pack ");
    bw.newLine();
    bw.flush();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    } finally {
    if (bw != null) try {
    bw.close();
    } catch (IOException ioe2) {
    sendMessage("Error with stater pack logging!");
    }
    }
    }
    Step two: Make a TXT file called "starters" into the "data" folder in your server.

    Ok now ill tell ya how this work, when u type :tarter u get an "starter pack" that its 10m in this case, u can change that by looking for "addItem(995,10000000);" and change "10000000" for the amount you want, and you can also make so giv items instead of money by changin "995" for the ID of the item u want... Now how the black mark works? Easy when a player do :tarter command, it saves and when he try to do it again it automatic black mark that guy and disconnect him , and send a message to all players that this guy was trying to cheat. How to remove the disconnect thing? easy find "disconnected = true;" and erase it =)..

    Well thats all any questions about this lil tut pm me...
    Hope u like it =)



     

  2. #2  
    Member
    Join Date
    May 2007
    Age
    31
    Posts
    209
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Thanks i needed this but i have seen this at least 20 times
     

  3. #3  
    Thecowman
    Guest
    cool dude i might add later
     

  4. #4  
    is serisiuly cul.

    DJ Dan's Avatar
    Join Date
    Apr 2007
    Posts
    1,324
    Thanks given
    6
    Thanks received
    5
    Rep Power
    223
    A black mark is a bit harsh init?
     

  5. #5  
    Member
    Join Date
    May 2007
    Age
    31
    Posts
    209
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    um... actually you forgot to add something...
     

  6. #6  
    Respected Pr0ud Dad

    Systəx's Avatar
    Join Date
    Jun 2007
    Age
    40
    Posts
    245
    Thanks given
    1
    Thanks received
    0
    Rep Power
    279
    Quote Originally Posted by wildy View Post
    um... actually you forgot to add something...

    Can ya tell me what?



     

  7. #7  
    Whitey
    Guest
    You didnt add the Blackmark Bit. But Still, Its Easy to add a Ban or Stuff.
     

  8. #8  
    Respected Pr0ud Dad

    Systəx's Avatar
    Join Date
    Jun 2007
    Age
    40
    Posts
    245
    Thanks given
    1
    Thanks received
    0
    Rep Power
    279
    Quote Originally Posted by Whiteyboy5 View Post
    You didnt add the Blackmark Bit. But Still, Its Easy to add a Ban or Stuff.
    And what is this??(c)
    if(kitstarter >= 1)
    {
    PlayerHandler.messageToAll = (playerName + " Is a ....ing n00bie who just got themself a black mark");
    disconnected = true;
    //
    BufferedWriter bw = null;
    try {
    bw = new BufferedWriter(new FileWriter("logs/blackmarks.txt", true));
    bw.write(playerName+" Tryed to Cheat, black mark! ");
    bw.newLine();
    bw.flush();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    } finally {
    if (bw != null) try {
    bw.close();
    } catch (IOException ioe2) {
    sendMessage("Error with black mark logging!");
    }
    }



     

  9. #9  
    Whitey
    Guest
    Ah, Sorry MY Mistake. Should have read it better.
     

  10. #10  
    Community Veteran


    Join Date
    Dec 2006
    Age
    30
    Posts
    968
    Thanks given
    56
    Thanks received
    77
    Rep Power
    387
    thanks mate
    Rune-Server Veteran
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 50
    Last Post: 04-17-2014, 02:19 PM
  2. Replies: 12
    Last Post: 06-24-2011, 07:47 AM
  3. Starter Command
    By CTucker in forum Help
    Replies: 7
    Last Post: 03-20-2010, 11:21 PM
  4. [Useful] Starter Command
    By wh1p in forum Configuration
    Replies: 3
    Last Post: 05-18-2008, 02:21 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •