Thread: 1 error pls help

Results 1 to 6 of 6
  1. #1 1 error pls help 
    Registered Member
    Join Date
    Jul 2008
    Posts
    3,163
    Thanks given
    235
    Thanks received
    74
    Rep Power
    209
    int targetSlot = 0;
    targetSlot = itemType(wearID);
    int[] two_hand = { 1319, 4718, 4726, 1409, 4710, 7158, 15156 };
    for (int element : two_hand) {
    if ((wearID == element) && (playerEquipment[playerShield] > 0)) {
    if (playerHasItem(-1)) {
    addItem(playerEquipment[playerShield], 1);
    playerEquipment[playerShield] = -1;
    playerSE = CAM().GetStandAnim(wearID);
    playerSEW = CAM().GetWalkAnim(wearID);//gobackhere
    playerSER = CAM().GetRunAnim(wearID);
    } else {
    CAM().sendMessage("You can't wear this weapon with a shield");
    return false;
    }
    }
    if (itemType(wearID) == playerShield) {
    if (Item.itemTwoHanded[playerWeapon] || playerWeapon == 15156 && freeSlots() < 1) {
    CAM().sendMessage("You're inventory is too full!");
    return false;
    } else {
    remove(playerEquipment[playerWeapon], playerWeapon);
    playerSE = CAM().GetStandAnim(wearID);
    playerSEW = CAM().GetWalkAnim(wearID);//gobackhere
    playerSER = CAM().GetRunAnim(wearID);
    }
    }
    if (playerEquipment[playerShield] > 0) {
    if (Item.itemTwoHanded[wearID] && freeSlots() < 1) {
    CAM().sendMessage("You're inventory is too full!");
    return false;
    }
    }
    if (playerEquipment[playerShield] > 0 && Item.itemTwoHanded[wearID] && freeSlots() > 0 ) {
    remove(playerEquipment[playerWeapon], playerWeapon);
    playerSE = CAM().GetStandAnim(wearID);
    playerSEW = CAM().GetWalkAnim(wearID);
    playerSER = CAM().GetRunAnim(wearID);
    }
    if (playerEquipment[playerShield] > 0 && Item.itemTwoHanded[wearID] && freeSlots() < 1 ) {
    CAM().sendMessage("You're inventory is too full!4");
    return false;
    }
    if (itemType(wearID) == playerShield && playerEquipment[playerWeapon] == element || twoHanded(playerWeapon)) {
    CAM().sendMessage("You're inventory is too full!2");
    return false;
    }

    if ((itemType(wearID) == playerShield)
    && (playerEquipment[playerWeapon] == element)) {
    if (playerHasItem(-1)) {
    addItem(playerEquipment[playerWeapon], 1);
    playerEquipment[playerWeapon] = -1;
    playerSE = CAM().GetStandAnim(wearID);
    playerSEW = CAM().GetWalkAnim(wearID);//gobackhere
    playerSER = CAM().GetRunAnim(wearID);
    } else {
    CAM().sendMessage("You can't wear a shield with this weapon");
    return false;
    }
    }



    Galkon's Compiler
    By Galkon
    .\server\players\client.java:10094: cannot find symbol
    symbol : method twoHanded(int)
    location: class server.players.client
    if (itemType(wearID) == playerShield && playerEquipment[
    playerWeapon] == element || twoHanded(playerWeapon)) {

    ^
    Note: .\server\server.java uses or overrides a deprecated API.
    Note: Recompile with -Xlinteprecation for details.
    1 error
    Compile successful!
    Press any key to continue . . . how i can fix this errorpls help me
    what is wrong here?
    if (itemType(wearID) == playerShield && playerEquipment[playerWeapon] == element || twoHanded(playerWeapon)) {
    Reply With Quote  
     

  2. #2  
    Valar Morghulis

    Laxika's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    2,813
    Thanks given
    1,804
    Thanks received
    274
    Rep Power
    2128
    You missing the boolean what test, the weapon twohanded or not.

    Add this to your client.java:

    Code:
    public boolean twoHanded(int wep) {
    
    switch(wep) {
    case 111:
    case 222:
    case 333:
    //etcetc, the two handed weapons' ids
    return true;
    default:
    return false;
    }
    
    return false;
    }
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2008
    Posts
    3,163
    Thanks given
    235
    Thanks received
    74
    Rep Power
    209
    tyvm fixed
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jul 2008
    Posts
    3,163
    Thanks given
    235
    Thanks received
    74
    Rep Power
    209
    i have alittle proble now(i hate 2h weapons
    if i have equiped a granite maul and my inv is full and i try to wield a kite he work perfect he send me message with no space
    but if i have equiped a shield ,my inv is full and i try to wield a granite maul he delete my kite
    how i fix that problem

    here is the problem but idk how i can fix it
    pls help me i will rep!
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jul 2008
    Posts
    3,163
    Thanks given
    235
    Thanks received
    74
    Rep Power
    209
    someone pls^?
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    I would help, but, I can't read your code, or your writing.



    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
  •