Thread: Some Request And Some Helps

Results 1 to 8 of 8
  1. #1 Some Request And Some Helps 
    Officially Retired


    Join Date
    Oct 2007
    Age
    27
    Posts
    5,456
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    Need Help
    i try to added some dragon attack us with gfx.And it give me this error.
    Code:
        public void loadSpell(int i) {
            switch(npcs[i].npcType) {
                case 50://KBD
                int random = Misc.random(4);
                if (random == 0) {
                    npcs[i].projectileId = 393; //red
                    npcs[i].endGfx = 430;
                    npcs[i].attackType = 3;
                } else if (random == 1) {
                    npcs[i].projectileId = 394; //green
                    npcs[i].endGfx = 429;
                    npcs[i].attackType = 3;
                } else if (random == 2) {
                    npcs[i].projectileId = 395; //white
                    npcs[i].endGfx = 431;
                    npcs[i].attackType = 3;
                } else if (random == 3) {
                    npcs[i].projectileId = 396; //blue
                    npcs[i].endGfx = 428;
                    npcs[i].attackType = 3;
                } else if (random == 4) {
                    npcs[i].projectileId = -1; //melee
                    npcs[i].endGfx = -1;
                    npcs[i].attackType = 0;                
                }            
                break;
                case 53://Red Dragon
                case 941://Green Dragon
                case 55:// Blue Dragon
                case 1590://Bronze Dragon
                case 1591://Iron Dragon
                case 1592:// Steal Dragon
                int random = Misc.random(2);
                if (random == 0) {
                    npcs[i].projectileId = 393; //red
                    npcs[i].endGfx = 430;
                    npcs[i].attackType = 3;
                } else if (random == 1) {
                    npcs[i].projectileId = -1; //melee
                    npcs[i].endGfx = -1;
                    npcs[i].attackType = 0;                
                }            
                break;
    Error.
    Code:
    src\server\model\npcs\NPCHandler.java:1844: random is already defined in loadSpe
    ll(int)
                            int random = Misc.random(2);
                                ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    Some Command Request Base On Project Insanity.

    • Xteletome
    • pnpc
    Reply With Quote  
     

  2. #2  
    Registered Member Analed's Avatar
    Join Date
    Jan 2010
    Posts
    326
    Thanks given
    6
    Thanks received
    3
    Rep Power
    0
    Quote Originally Posted by 3 Hit U View Post
    Need Help
    i try to added some dragon attack us with gfx.And it give me this error.
    Code:
        public void loadSpell(int i) {
            switch(npcs[i].npcType) {
                case 50://KBD
                int random = Misc.random(4);
                if (random == 0) {
                    npcs[i].projectileId = 393; //red
                    npcs[i].endGfx = 430;
                    npcs[i].attackType = 3;
                } else if (random == 1) {
                    npcs[i].projectileId = 394; //green
                    npcs[i].endGfx = 429;
                    npcs[i].attackType = 3;
                } else if (random == 2) {
                    npcs[i].projectileId = 395; //white
                    npcs[i].endGfx = 431;
                    npcs[i].attackType = 3;
                } else if (random == 3) {
                    npcs[i].projectileId = 396; //blue
                    npcs[i].endGfx = 428;
                    npcs[i].attackType = 3;
                } else if (random == 4) {
                    npcs[i].projectileId = -1; //melee
                    npcs[i].endGfx = -1;
                    npcs[i].attackType = 0;                
                }            
                break;
                case 53://Red Dragon
                case 941://Green Dragon
                case 55:// Blue Dragon
                case 1590://Bronze Dragon
                case 1591://Iron Dragon
                case 1592:// Steal Dragon
                int random = Misc.random(2);
                if (random == 0) {
                    npcs[i].projectileId = 393; //red
                    npcs[i].endGfx = 430;
                    npcs[i].attackType = 3;
                } else if (random == 1) {
                    npcs[i].projectileId = -1; //melee
                    npcs[i].endGfx = -1;
                    npcs[i].attackType = 0;                
                }            
                break;
    Error.
    Code:
    src\server\model\npcs\NPCHandler.java:1844: random is already defined in loadSpe
    ll(int)
                            int random = Misc.random(2);
                                ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    Some Command Request Base On Project Insanity.

    • Xteletome
    • pnpc
    Code:
    if (playerCommand.startsWith("xteletome")) {
    try {
    String teleTo = playerCommand.substring(10);
    for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    if(Server.playerHandler.players[i] != null) {
    if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(teleTo)) {
    Client p = (Client) Server.playerHandler.players[i];
    p.getPA().movePlayer(c.absX, c.absY, c.heightLevel);
    }
    }
    }
    } catch(Exception e) {
    c.sendMessage("Player is not online.");
    }
    }
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Officially Retired


    Join Date
    Oct 2007
    Age
    27
    Posts
    5,456
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    thank..got other commands?
    Reply With Quote  
     

  5. #4  
    Registered Member Analed's Avatar
    Join Date
    Jan 2010
    Posts
    326
    Thanks given
    6
    Thanks received
    3
    Rep Power
    0
    Quote Originally Posted by 3 Hit U View Post
    thank..got other commands?
    kick command
    Code:
    				if (playerCommand.startsWith("kick")) {
    					try {
    						String teleTo = playerCommand.substring(5);
    						for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    							if(Server.playerHandler.players[i] != null) {
    								if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(teleTo)) {
    									Client p = (Client) Server.playerHandler.players[i];
    									p.disconnected = true;
    								}
    							}
    						}
    					} catch(Exception e) {
    					c.sendMessage("Player is not online.");
    					}
    				}
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. Thankful user:


  7. #5  
    Officially Retired


    Join Date
    Oct 2007
    Age
    27
    Posts
    5,456
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    thank...i need :npc command
    Reply With Quote  
     

  8. #6  
    Registered Member
    Join Date
    Oct 2007
    Posts
    46
    Thanks given
    0
    Thanks received
    0
    Rep Power
    3
    As for the error, you just need to change the name of the second int random. It was defined in the beginning of the void.

    Code:
        public void loadSpell(int i) {
            switch(npcs[i].npcType) {
                case 50://KBD
                int random = Misc.random(4);
                if (random == 0) {
                    npcs[i].projectileId = 393; //red
                    npcs[i].endGfx = 430;
                    npcs[i].attackType = 3;
                } else if (random == 1) {
                    npcs[i].projectileId = 394; //green
                    npcs[i].endGfx = 429;
                    npcs[i].attackType = 3;
                } else if (random == 2) {
                    npcs[i].projectileId = 395; //white
                    npcs[i].endGfx = 431;
                    npcs[i].attackType = 3;
                } else if (random == 3) {
                    npcs[i].projectileId = 396; //blue
                    npcs[i].endGfx = 428;
                    npcs[i].attackType = 3;
                } else if (random == 4) {
                    npcs[i].projectileId = -1; //melee
                    npcs[i].endGfx = -1;
                    npcs[i].attackType = 0;                
                }            
                break;
                case 53://Red Dragon
                case 941://Green Dragon
                case 55:// Blue Dragon
                case 1590://Bronze Dragon
                case 1591://Iron Dragon
                case 1592:// Steal Dragon
                int random2 = Misc.random(2);
                if (random2 == 0) {
                    npcs[i].projectileId = 393; //red
                    npcs[i].endGfx = 430;
                    npcs[i].attackType = 3;
                } else if (random2 == 1) {
                    npcs[i].projectileId = -1; //melee
                    npcs[i].endGfx = -1;
                    npcs[i].attackType = 0;                
                }            
                break;
    Reply With Quote  
     

  9. #7  
    Registered Member Yodoxin's Avatar
    Join Date
    Sep 2008
    Age
    30
    Posts
    190
    Thanks given
    0
    Thanks received
    10
    Rep Power
    54
    Just take the 'int' from infrom of the random set, so it should just be

    Code:
    random = Misc.random(2);
    as for pnpc command:

    Code:
    	if(command.startsWith("pnpc")){
    		int npc = Integer.parseInt(command.substring(5));
    		if(npc < 4000){
    			npcId = npc;
    			npcId2 = npc;
    			isNpc = true;
    			updateRequired = true;
    			appearanceUpdateRequired = true;
    		}
    	}
    *Ahem* I will not be doing that again...
    Reply With Quote  
     

  10. #8  
    Officially Retired


    Join Date
    Oct 2007
    Age
    27
    Posts
    5,456
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    Quote Originally Posted by Yodoxin View Post
    Just take the 'int' from infrom of the random set, so it should just be

    Code:
    random = Misc.random(2);
    as for pnpc command:

    Code:
    	if(command.startsWith("pnpc")){
    		int npc = Integer.parseInt(command.substring(5));
    		if(npc < 4000){
    			npcId = npc;
    			npcId2 = npc;
    			isNpc = true;
    			updateRequired = true;
    			appearanceUpdateRequired = true;
    		}
    	}
    Code:
    src\server\model\players\packets\Commands.java:157: cannot find symbol
    symbol  : variable command
    location: class server.model.players.packets.Commands
            if(command.startsWith("pnpc")){
               ^
    src\server\model\players\packets\Commands.java:158: cannot find symbol
    symbol  : variable command
    location: class server.model.players.packets.Commands
                    int npc = Integer.parseInt(command.substring(5));
                                               ^
    src\server\model\players\packets\Commands.java:160: cannot find symbol
    symbol  : variable npcId
    location: class server.model.players.packets.Commands
                            npcId = npc;
                            ^
    src\server\model\players\packets\Commands.java:161: cannot find symbol
    symbol  : variable npcId2
    location: class server.model.players.packets.Commands
                            npcId2 = npc;
                            ^
    src\server\model\players\packets\Commands.java:162: cannot find symbol
    symbol  : variable isNpc
    location: class server.model.players.packets.Commands
                            isNpc = true;
                            ^
    src\server\model\players\packets\Commands.java:163: cannot find symbol
    symbol  : variable updateRequired
    location: class server.model.players.packets.Commands
                            updateRequired = true;
                            ^
    src\server\model\players\packets\Commands.java:164: cannot find symbol
    symbol  : variable appearanceUpdateRequired
    location: class server.model.players.packets.Commands
                            appearanceUpdateRequired = true;
                            ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    7 errors
    Press any key to continue . . .
    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
  •