Thread: More advanced features with members or "Premium"

Results 1 to 9 of 9
  1. #1 More advanced features with members or "Premium" 
    Registered Member ninja's Avatar
    Join Date
    Aug 2006
    Age
    83
    Posts
    400
    Thanks given
    0
    Thanks received
    1
    Rep Power
    44
    Part A
    Members only Yell and making yell Display If player is member.

    Making Yell members only:
    Open up client.java and find
    Code:
    if (command.startsWith("yell")
    Replace the whole command with this to make yelling members only:
    Code:
    if (command.startsWith("yell") && playerIsMember == 1)    {
    PlayerHandler.messageToAll = (""+playerName+": "+command.substring(5)+":chalreq:");
    }
    
    if (command.startsWith("yell") && playerIsMember == 0)    {
    sendMessage("You need to be a member to use this feature.");
    }
    If you want to make it display the players membership status in the yell you would simply change the yell command to this:
    Code:
    if (command.startsWith("yell") && playerIsMember == 1)    {
    PlayerHandler.messageToAll = ("Member "+playerName+": "+command.substring(5)+":chalreq:");
    }
    else if (command.startsWith("yell") && playerIsMember == 0)    {
    PlayerHandler.messageToAll = ("Free Player "+playerName+": "+command.substring(5)+":chalreq:");
    }
    Part B
    Making Members/Non-Members worlds
    In client.java in the world you want to be members only, find:
    Code:
    public int readSave() {
    Next, somewhere in that void add this:
    Code:
    if(playerIsMember == 0) {
    returnCode = 12; //cannot log into a members world
    disconnected = true;
    }
     

  2. #2  
    Registered Member
    fabjan's Avatar
    Join Date
    Jul 2007
    Age
    30
    Posts
    552
    Thanks given
    0
    Thanks received
    0
    Rep Power
    101
    nice tut but why does every1 one use playerismember == 1/0
    i dont get it why do you want a nummber to declare such a thing
    it can only cause troubles
    why not use a boolean and make it false or true
    thats my opinion, sorry for off-topic
    but nicely done anyway
    i think its very basic java (if its even basic niveau) but some ppl might want to c+p this
    Please vote:

    btb.servegame.com:
     

  3. #3  
    project-rs owner
    Join Date
    Sep 2006
    Age
    32
    Posts
    914
    Thanks given
    4
    Thanks received
    4
    Rep Power
    49
    it does not mind if you use boolean or int but ints is better because you can make diff member ships like vip/premuim so it would be easy to upgrade the membership

    and you could make it like this

    Code:
    if (command.startsWith("yell"))    {
    if(playerIsMember == 0){
    PlayerHandler.messageToAll = ("Free Player "+playerName+": "+command.substring(5)+":chalreq:");
    } else {
    PlayerHandler.messageToAll = ("Member "+playerName+": "+command.substring(5)+":chalreq:");
    }
     

  4. #4  
    ~Legend Rene
    Guest
    A boolean has 2 options either true or false , an int can give you options up to 2147###### blabla.
     

  5. #5  
    Community Veteran

    Shobaky's Avatar
    Join Date
    Oct 2006
    Posts
    1,252
    Thanks given
    105
    Thanks received
    101
    Rep Power
    1115
    Agreed with legend
    Shit just don't change to this day




     

  6. #6  
    Registered Member Dakota Lesmercy's Avatar
    Join Date
    Sep 2007
    Posts
    289
    Thanks given
    0
    Thanks received
    0
    Rep Power
    13
    Quote Originally Posted by R O F L View Post
    Agreed with legend
    I agree with you, which agrees with Legend... LOL!
     

  7. #7  
    Whiteyb
    Guest
    You know that you will need some kind of method to make people members before this can work And most p servers make you start with playerIsMember == 1
     

  8. #8  
    ~Legend Rene
    Guest
    I think this is sort of an attachment to your tut

    Everybody agrees with me
     

  9. #9  
    Registered Member ninja's Avatar
    Join Date
    Aug 2006
    Age
    83
    Posts
    400
    Thanks given
    0
    Thanks received
    1
    Rep Power
    44
    Quote Originally Posted by Whiteyb View Post
    You know that you will need some kind of method to make people members before this can work And most p servers make you start with playerIsMember == 1
    Well the topic is "More advanced features with members or Premium" not "How to set up members and add some extra features to it"
    And thanks for the feedback guys.
     


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
  •