Thread: Killing NPC's

Results 1 to 5 of 5
  1. #1 Killing NPC's 
    Registered Member

    Join Date
    Mar 2008
    Age
    32
    Posts
    749
    Thanks given
    18
    Thanks received
    31
    Rep Power
    130
    Ok so when i finish the PC game im trying to kill all spawned NPC's and portals....

    CANNOT get it working..
    I have no idea why this would not work, im trying to call anything that kills it...?

    Code:
    		for (int j = 0; j < Server.npcHandler.npcs.length; j++) {
    			if (Server.npcHandler.npcs[j] != null) {
    				if (Server.npcHandler.npcs[j].npcType >= 6142 && Server.npcHandler.npcs[j].npcType <= 6145) {
    					Server.npcHandler.npcs[j].isDead = true;
    					Server.npcHandler.npcs[j] = null;
    					}
    				if (Server.npcHandler.npcs[j].npcType = 3727 && Server.npcHandler.npcs[j].npcType <= 3776) {
    					Server.npcHandler.npcs[j].HP = 0;
    					Server.npcHandler.npcs[j].isDead = true;
    					Server.npcHandler.npcs[j] = null;
    					}
    					
    			}			
    		}
    Message me for a DETAILED security scan of your website.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Nov 2009
    Posts
    3,052
    Thanks given
    112
    Thanks received
    838
    Rep Power
    740
    declare this in client
    Code:
        public void killpcnpcs()
        {
            for(int i = 0; i < server.npcHandler.maxNPCs; i++)
                if(server.npcHandler.npcs[i] != null)
                {
    		if(server.npcHandler.npcs[i].npcType == 3727 || server.npcHandler.npcs[i].npcType == 3728 || server.npcHandler.npcs[i].npcType == 3729 || server.npcHandler.npcs[i].npcType == 3730 || server.npcHandler.npcs[i].npcType == 3731 || server.npcHandler.npcs[i].npcType == 3732 || server.npcHandler.npcs[i].npcType == 3733 || server.npcHandler.npcs[i].npcType == 3734 || server.npcHandler.npcs[i].npcType == 3735 || server.npcHandler.npcs[i].npcType == 3736 || server.npcHandler.npcs[i].npcType == 3737 || server.npcHandler.npcs[i].npcType == 3738 || server.npcHandler.npcs[i].npcType == 3739 || server.npcHandler.npcs[i].npcType == 3740 || server.npcHandler.npcs[i].npcType == 3741 || server.npcHandler.npcs[i].npcType == 3742 || server.npcHandler.npcs[i].npcType == 3743 || server.npcHandler.npcs[i].npcType == 3744 || server.npcHandler.npcs[i].npcType == 3745 || server.npcHandler.npcs[i].npcType == 3746 || server.npcHandler.npcs[i].npcType == 3747 || server.npcHandler.npcs[i].npcType == 3748 || server.npcHandler.npcs[i].npcType == 3749 || server.npcHandler.npcs[i].npcType == 3750 || server.npcHandler.npcs[i].npcType == 3751 || server.npcHandler.npcs[i].npcType == 3752 || server.npcHandler.npcs[i].npcType == 3753 || server.npcHandler.npcs[i].npcType == 3754 || server.npcHandler.npcs[i].npcType == 3755 || server.npcHandler.npcs[i].npcType == 3756 || server.npcHandler.npcs[i].npcType == 3757 || server.npcHandler.npcs[i].npcType == 3758 || server.npcHandler.npcs[i].npcType == 3759 || server.npcHandler.npcs[i].npcType == 3760 || server.npcHandler.npcs[i].npcType == 3761 || server.npcHandler.npcs[i].npcType == 3762 || server.npcHandler.npcs[i].npcType == 3763 || server.npcHandler.npcs[i].npcType == 3764 || server.npcHandler.npcs[i].npcType == 3765 || server.npcHandler.npcs[i].npcType == 3766 || server.npcHandler.npcs[i].npcType == 3767 || server.npcHandler.npcs[i].npcType == 3768 || server.npcHandler.npcs[i].npcType == 3769 || server.npcHandler.npcs[i].npcType == 3770 || server.npcHandler.npcs[i].npcType == 3771 || server.npcHandler.npcs[i].npcType == 3772 || server.npcHandler.npcs[i].npcType == 3773 || server.npcHandler.npcs[i].npcType == 3774 || server.npcHandler.npcs[i].npcType == 3775 || server.npcHandler.npcs[i].npcType == 3776)
    		{
    		if(server.npcHandler.npcs[i].heightLevel == heightLevel)
    		{
                    server.npcHandler.npcs[i].absX = 0;
                    server.npcHandler.npcs[i].absY = 0;
    		server.npcHandler.npcs[i].followPlayer = 0;
                }
    	}
        }
    }
    and make it call when pc ends
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Mar 2008
    Age
    32
    Posts
    749
    Thanks given
    18
    Thanks received
    31
    Rep Power
    130
    Still not working
    Message me for a DETAILED security scan of your website.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Feb 2009
    Age
    27
    Posts
    2,861
    Thanks given
    127
    Thanks received
    226
    Rep Power
    700
    owner blade, that won't kill them. It just tps them to 0,0, meaning if your server goes through 50 games of pc in an hour, that's more than 1000 npc there.
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Mar 2008
    Age
    32
    Posts
    749
    Thanks given
    18
    Thanks received
    31
    Rep Power
    130
    nvm i figured it out. Thanks anyways
    Message me for a DETAILED security scan of your website.
    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
  •