Check Gender in Scripts

Results 1 to 9 of 9
  1. #1
    Member magicalimp is offline
    MemberRank
    Jul 2008 Join Date
    97Posts

    Check Gender in Scripts

    A lot of servers have the "starter pack" which gives you both a male and female sauna robe, which I thought was pretty stupid...

    Method 1: Using MapleCharacter only in the source.

    Add this function in NPCConversationManager.java (net/sf/odinms/scripting/npc):

    Code:
            public int getGender() {
                // gender (0 = male, 1 = female)
                return getPlayer().getGender();
            }
    getPlayer() is an inherited function from AbstractPlayerInteraction.java, if you're wondering.

    In your scripts do:
    Code:
            if (cm.getGender() == 0) {
                    // Receive male clothing
            } else {
                    // Receive female clothing
            }
    Method 2: Using MapleCharacter in Scripts

    Or, if you don't mind using getPlayer() in scripts you can do:

    Code:
            if (cm.getPlayer().getGender() == 0) {
                    // Receive male clothing
            } else {
                    // Receive female clothing
            }
    without having to copy the first function.


  2. #2
    Infraction Banned nejevoli is offline
    MemberRank
    May 2008 Join Date
    ♥ In Your HeartLocation
    574Posts

    Re: [Release] Check Gender in Scripts

    thanks, its helpful :D

  3. #3
    Valued Member TeamH is offline
    MemberRank
    Jun 2008 Join Date
    126Posts

    Re: [Release] Check Gender in Scripts

    my friends needed this thx

  4. #4
    Account Upgraded | Title Enabled! ryuko is offline
    MemberRank
    Apr 2008 Join Date
    612Posts

    Re: [Release] Check Gender in Scripts

    uh this is already coded isnt it? My nimakin and Kin npcs check to see if you're male or female 0_0

  5. #5
    Apprentice khikay is offline
    MemberRank
    Aug 2008 Join Date
    22Posts

    Re: [Release] Check Gender in Scripts

    nice thnx for the release !

  6. #6
    Account Upgraded | Title Enabled! megoesrawr is offline
    MemberRank
    May 2008 Join Date
    CaliforniaLocation
    873Posts

    Re: [Release] Check Gender in Scripts

    This was already released?

  7. #7
    Account Upgraded | Title Enabled! echicken is offline
    MemberRank
    Apr 2008 Join Date
    1,402Posts

    Re: [Release] Check Gender in Scripts

    I think this was already released.

  8. #8
    You've got my respect! Traitor is offline
    MemberRank
    Apr 2008 Join Date
    Portland,OregonLocation
    959Posts

    Re: [Release] Check Gender in Scripts

    I think it was in odinms' first release.

  9. #9
    Infraction Banned XxOsirisxX is offline
    MemberRank
    Jul 2008 Join Date
    2,456Posts

    Re: [Release] Check Gender in Scripts

    This was already in OdinMS files.



Advertisement