Thread: Compiling errors

Results 1 to 5 of 5
  1. #1 Compiling errors 
    Registered Member
    Coolline's Avatar
    Join Date
    Sep 2009
    Posts
    90
    Thanks given
    2
    Thanks received
    3
    Rep Power
    137
    Code:
     else if (npcs[NPCID].npcType == 50) {
    			if (playerEquipment[playerShield] == 16002) {
                                npcs[NPCID].animNumber = 91; // KBD attack  
                                hitDiff = 10 + misc.random(20);   
    			} else {
                                npcs[NPCID].animNumber = 91; // KBD attack  
                                hitDiff = 40 + misc.random(60); 
    			}  
                            }
    Thats the code I tried to make. I get these errors.

    Code:
    NPCHandler.java:2474: cannot find symbol
    symbol  : variable playerEquipment
    location: class NPCHandler
                            if (playerEquipment[playerShield] == 16002) {
                                ^
    NPCHandler.java:2474: cannot find symbol
    symbol  : variable playerShield
    location: class NPCHandler
                            if (playerEquipment[playerShield] == 16002) {
                                                ^
    Note: stream.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 errors
    Finished!
    Press any key to continue . . .
    Thats my error. How can I fix it? + I'm on Czar
    Reply With Quote  
     

  2. #2  
    Registered Member
    G0nzo's Avatar
    Join Date
    Feb 2009
    Posts
    4,960
    Thanks given
    514
    Thanks received
    546
    Rep Power
    1735
    Code:
     else if (npcs[NPCID].npcType == 50) {
    			if (c.playerEquipment[c.playerShield] == 16002) {
                                npcs[NPCID].animNumber = 91; // KBD attack  
                                hitDiff = 10 + misc.random(20);   
    			} else {
                                npcs[NPCID].animNumber = 91; // KBD attack  
                                hitDiff = 40 + misc.random(60); 
    			}  
                            }
    or

    Code:
     else if (npcs[NPCID].npcType == 50) {
    			if (p.playerEquipment[p.playerShield] == 16002) {
                                npcs[NPCID].animNumber = 91; // KBD attack  
                                hitDiff = 10 + misc.random(20);   
    			} else {
                                npcs[NPCID].animNumber = 91; // KBD attack  
                                hitDiff = 40 + misc.random(60); 
    			}  
                            }
    Computer Science Graduate, Java Expert
    Need help with something? PM me
    Reply With Quote  
     

  3. #3  
    Registered Member
    Coolline's Avatar
    Join Date
    Sep 2009
    Posts
    90
    Thanks given
    2
    Thanks received
    3
    Rep Power
    137
    Both failed.



    Code:
    NPCHandler.java:2474: cannot find symbol
    symbol  : variable p
    location: class NPCHandler
                            if (p.playerEquipment[p.playerShield] == 16002) {
                                ^
    NPCHandler.java:2474: cannot find symbol
    symbol  : variable p
    location: class NPCHandler
                            if (p.playerEquipment[p.playerShield] == 16002) {
                                                  ^
    Note: stream.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 errors
    Finished!
    Press any key to continue . . .

    and the same with c.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Feb 2009
    Posts
    554
    Thanks given
    7
    Thanks received
    19
    Rep Power
    340
    Quote Originally Posted by Coolline View Post
    Both failed.



    Code:
    NPCHandler.java:2474: cannot find symbol
    symbol  : variable p
    location: class NPCHandler
                            if (p.playerEquipment[p.playerShield] == 16002) {
                                ^
    NPCHandler.java:2474: cannot find symbol
    symbol  : variable p
    location: class NPCHandler
                            if (p.playerEquipment[p.playerShield] == 16002) {
                                                  ^
    Note: stream.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 errors
    Finished!
    Press any key to continue . . .

    and the same with c.
    Find the player that the npc is attacking, convert it to an instance of client then use X.playerShield - where X is your instance of client.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Coolline's Avatar
    Join Date
    Sep 2009
    Posts
    90
    Thanks given
    2
    Thanks received
    3
    Rep Power
    137
    If I knew how to do that, I wouldn't be here. Would I?
    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
  •