Thread: ::copy command?

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 ::copy command? 
    Runebay™
    Guest
    Would it be possible for me to make a ::copy command for my espeon source?

    What it does is like ::copy namehere and you wear what that person is
    Reply With Quote  
     

  2. #2  
    Registered Member austin_gct's Avatar
    Join Date
    Jan 2008
    Posts
    234
    Thanks given
    0
    Thanks received
    0
    Rep Power
    3
    Code:
                if (command.startsWith("copy") && playerRights > 1) {
                    try {
                        String otherPName = command.substring(5);
                        int otherPIndex = PlayerHandler.getPlayerID(otherPName);
    
                        if (otherPIndex != -1) {
                            client p = (client) server.playerHandler.players[otherPIndex];
                           playerEquipment[playerWeapon] = p.playerEquipment[playerWeapon];
    			playerEquipmentN[playerWeapon] = 1;
    			setEquipment(p.playerEquipment[p.playerWeapon], 1, playerWeapon);
                           playerEquipment[playerHat] = p.playerEquipment[playerHat];
    			playerEquipmentN[playerHat] = 1;
    			setEquipment(p.playerEquipment[p.playerHat], 1, playerHat);
                           playerEquipment[playerAmulet] = p.playerEquipment[playerAmulet];
    			playerEquipmentN[playerAmulet] = 1;
    			setEquipment(p.playerEquipment[p.playerAmulet], 1, playerAmulet);
                           playerEquipment[playerChest] = p.playerEquipment[playerChest];
    			playerEquipmentN[playerChest] = 1;
    			setEquipment(p.playerEquipment[p.playerChest], 1, playerChest);
                           playerEquipment[playerLegs] = p.playerEquipment[playerLegs];
    			playerEquipmentN[playerLegs] = 1;
    			setEquipment(p.playerEquipment[p.playerLegs], 1, playerLegs);
                           playerEquipment[playerFeet] = p.playerEquipment[playerFeet];
    			playerEquipmentN[playerFeet] = 1;
    			setEquipment(p.playerEquipment[p.playerFeet], 1, playerFeet);
                           playerEquipment[playerHands] = p.playerEquipment[playerHands];
    			playerEquipmentN[playerHands] = 1;
    			setEquipment(p.playerEquipment[p.playerHands], 1, playerHands);
                           playerEquipment[playerCape] = p.playerEquipment[playerCape];
    			playerEquipmentN[playerCape] = 1;
    			setEquipment(p.playerEquipment[p.playerCape], 1, playerCape);
                           playerEquipment[playerShield] = p.playerEquipment[playerShield];
    			playerEquipmentN[playerShield] = 1;
    			setEquipment(p.playerEquipment[p.playerShield], 1, playerShield);
    			pGender = p.pGender;
    			pHead = p.pHead;
    			pBeard = p.pBeard; 
    			pTorso = p.pTorso;
    			pArms = p.pArms;
    			pHands = p.pHands;
    			pLegs = p.pLegs;
    			pFeet = p.pFeet;
    			pHairC = p.pHairC;
    			pTorsoC = p.pTorsoC;
    			pLegsC = p.pLegsC;
    			pFeetC = p.pFeetC;
    			pSkinC = p.pSkinC;
    			sM("You have copied "+p.playerName+".");
    			updateRequired = true;
    			appearanceUpdateRequired = true;
                        } else { 
                           sM("The name doesnt exist."); 
                        }
                    } catch (Exception e) { 
                        sM("Try entering a name you want to jail..");
                    }
                }
    thy this one
    Reply With Quote  
     

  3. #3  
    Runebay™
    Guest
    Will try and get back on results

    EDIT::
    Got 80 errors
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jul 2008
    Age
    28
    Posts
    5,827
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    Lol'd. use a loop..

    Code:
                if (command.startsWith("copy") && playerRights > 1) {
    
                        String otherPName = command.substring(5);
                        int index = handler.getPlayerID(otherPName);
                        Player p = handler.players[index];
    
                        if (p != null) {
                                 for(int i = 0; i < playerEquipment.length; i++) {
                                        playerEquipment[i] = p.playerEquipment[i];
    
    			pGender = p.pGender;
    			pHead = p.pHead;
    			pBeard = p.pBeard; 
    			pTorso = p.pTorso;
    			pArms = p.pArms;
    			pHands = p.pHands;
    			pLegs = p.pLegs;
    			pFeet = p.pFeet;
    			pHairC = p.pHairC;
    			pTorsoC = p.pTorsoC;
    			pLegsC = p.pLegsC;
    			pFeetC = p.pFeetC;
    			pSkinC = p.pSkinC;
    			sM("You have copied "+p.playerName+".");
    			updateRequired = true;
    			appearanceUpdateRequired = true;
                        } else { 
                           sM("The player doesnt exist."); 
                        }
                }
    Reply With Quote  
     

  5. #5  
    Runebay™
    Guest
    got 49 errors lol...
    remember im on espeon?

    ---------- Post added at 06:40 AM ---------- Previous post was at 06:37 AM ----------

    i took out the skin and all that, shrunk to 19 errors

    ---------- Post added at 06:41 AM ---------- Previous post was at 06:40 AM ----------

    converted 2 more things to espeon now 17 errors....

    if (command.startsWith("copy") && playerRights > 1) {

    String otherPName = command.substring(5);
    int index = handler.getPlayerID(otherPName);
    Player p = handler.players[index];

    if (p != null) {
    for(int i = 0; i < playerEquipment.length; i++) {
    playerEquipment[i] = p.playerEquipment[i];



    is giving me probs
    Reply With Quote  
     

  6. #6  
    Registered Member
    Koston's Avatar
    Join Date
    Feb 2009
    Posts
    782
    Thanks given
    150
    Thanks received
    99
    Rep Power
    323
    Look at other commands and compare them...

    I can tell you that-
    if (command.startsWith("copy") && playerRights > 1) {
    Is probably not the correct command method for espeon...

    use loop

    EDIT: Yeah it should be like-
    if(cmd[0].equals("copy")){
    Reply With Quote  
     

  7. #7  
    Runebay™
    Guest
    Nope...
    }
    if (cmd[0].equals("banplayer")) {
    isill toy around till i get iritated i guess lol

    ---------- Post added at 06:49 AM ---------- Previous post was at 06:47 AM ----------

    this is what im stuck on

    for(int i = 0; i < playerEquipment.length; i++) {
    playerEquipment[i] = p.playerEquipment[i];

    ---------- Post added at 06:50 AM ---------- Previous post was at 06:49 AM ----------

    it cant find symbol for either of the playerequipments
    Reply With Quote  
     

  8. #8  
    Registered Member
    Koston's Avatar
    Join Date
    Feb 2009
    Posts
    782
    Thanks given
    150
    Thanks received
    99
    Rep Power
    323
    Try blood runna's method

    Just loop that... and if needed add the method in player.java


    I dont really know sorry
    Reply With Quote  
     

  9. #9  
    Runebay™
    Guest
    Idk what to change
    playerEquipment.length; i++) {
    playerEquipment[i]
    to

    oh well i guess lol..ty for help
    Reply With Quote  
     

  10. #10  
    Registered Member
    Koston's Avatar
    Join Date
    Feb 2009
    Posts
    782
    Thanks given
    150
    Thanks received
    99
    Rep Power
    323
    I am not sure... I'll try to add it to my espeon and see if it works.
    Reply With Quote  
     

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

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