Thread: "cannot be applied"

Results 1 to 3 of 3
  1. #1 "cannot be applied" 
    Registered Member
    Vox''s Avatar
    Join Date
    Nov 2008
    Age
    31
    Posts
    3,113
    Thanks given
    49
    Thanks received
    181
    Rep Power
    731
    im making aggressive npcs on my emulous 1.7, and i have everything almost 100%. i compiled, got no errors, but when i tried it, the npc didnt attack. so i tried adding this into my process in npchandler.java
    Code:
    for (int i = 0; i < maxNPCs; i++) {
    			if (npcs[i] != null) {
    				annoyNpcs(i);
    but when i try to compile it, i get this error
    Code:
    ------ Compiling ------
    .\server\model\npcs\NPCHandler.java:357: annoyNpcs(server.model.players.Client,i
    nt) in server.model.npcs.NPCHandler cannot be applied to (int)
                                    annoyNpcs(i);
                                    ^
    1 error
    Press any key to continue . . .
    what do i do?

    Quote Originally Posted by Zirtrix View Post
    So I've recently changed some things in the server, but when i compile it says
    Code:
    source\server\model\players\packets\Commands.java: 58: error: cannot find symbol
    This.Antileech("Remove This Line");
    ^
    Anyone know the problem?
    Student and Developer for http://www.rune-server.org/runescape...pve-based.html
    Reply With Quote  
     

  2. #2  
    Registered Member
    Whired's Avatar
    Join Date
    Aug 2007
    Posts
    2,126
    Thanks given
    238
    Thanks received
    500
    Rep Power
    822
    You need a Client argument as well.
    So lets say somewhere up above it says
    Code:
    Client c = /*blah blah*/;
    You would probably pass Client 'c' as the argument:
    Code:
    annoyNpcs(c, i);
    I guess if you wanted the NPC to attack you, you would do something like:
    Code:
    for(server.model.players.Client c : server.allPlayers)//where allPlayers is a list of all of your players
    {
    if(c.userName == "Your Name")
    {
    annoyNpcs(c, i);
    }
    }
    Reply With Quote  
     

  3. #3  
    Registered Member
    Vox''s Avatar
    Join Date
    Nov 2008
    Age
    31
    Posts
    3,113
    Thanks given
    49
    Thanks received
    181
    Rep Power
    731
    uhh sorry, i still dont understand how i would implant it.

    Quote Originally Posted by Zirtrix View Post
    So I've recently changed some things in the server, but when i compile it says
    Code:
    source\server\model\players\packets\Commands.java: 58: error: cannot find symbol
    This.Antileech("Remove This Line");
    ^
    Anyone know the problem?
    Student and Developer for http://www.rune-server.org/runescape...pve-based.html
    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
  •