Thread: Starting items

Results 1 to 5 of 5
  1. #1 Starting items 
    sunscape
    Guest
    K i want to add items to my server but i do not know how

    I dont want a starter command i want it to appear the first time you log in so could somebody help me with that
    Reply With Quote  
     

  2. #2  
    Registered Member
    Whired's Avatar
    Join Date
    Aug 2007
    Posts
    2,126
    Thanks given
    238
    Thanks received
    500
    Rep Power
    822
    You would need to have a boolean that saves to the player file. From there I can give you a general idea..
    Code:
    public boolean hasStarter = false;//To be loaded/saved
    ...
    //Wherever you log in-
    sendMessage("Welcome to Sunscape");//Whatever your welcome msg is
    if(!hasStarter)
    sendMessage("Type ::starter to receive your starter kit!");
    
    //Wherever your commands are
    if(command.equalsIgnoreCase("Starter"))
    {
    if(hasStarter)
    sendMessage("You have already recieved your starter kit!");
    else
    {
    addItem(995, 25000);//Add some items
    sendMessage("You have been given a starter kit!");
    hasStarter = true;
    playerSave();//save their file so they can't get multiple kits
    }
    }
    That should point you in the right direction. Method names vary, but you should be able to figure it out.
    Reply With Quote  
     

  3. #3  
    Registered Member
    No Go_JoE's Avatar
    Join Date
    May 2008
    Posts
    1,357
    Thanks given
    44
    Thanks received
    142
    Rep Power
    480
    what server base you using? check your client.java for AddItem if it's there do Additem(id, amount);
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Aug 2008
    Posts
    492
    Thanks given
    1
    Thanks received
    8
    Rep Power
    10
    void initialize...

    addItem(id, amount);
    Message if you can hook up a domain or sweet banner for free
    Reply With Quote  
     

  5. #5  
    Registered Member
    Whired's Avatar
    Join Date
    Aug 2007
    Posts
    2,126
    Thanks given
    238
    Thanks received
    500
    Rep Power
    822
    There IS an echo in here!!
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •