Basically i have tried so many times to get this to work ....
Basically what i want to do is, Instead of having 1 code for each npc, i want all npc's to be in one code
EG
Instead of this, where each npc has its own code! I want it to be like, Every npc that give's 1 point, is in this code!
Code:
if (npcs[i].npcType == 1265) {
c.randomPoints += 1;
c.sendMessage("You have been awarded [<col=990000>1</col>] NPC point!");
if (npcs[i].npcType == 9999) {
c.randomPoints += 1;
c.sendMessage("You have been awarded [<col=990000>1</col>] NPC point!");
if (npcs[i].npcType == 1010) {
c.randomPoints += 1;
c.sendMessage("You have been awarded [<col=990000>1</col>] NPC point!");
}
Tried this, and only the first npc gives the NPC point and send's that message, the other 2 npc's listed dont!
Code:
if (c != null) {
int[] NpcMonstersPointsSystem = { 1265, 1678, 117};
for (int j : NpcMonstersPointsSystem) {
if (npcs[i].npcType == j) {
c.randomPoints += 1;
c.sendMessage("You Have Been Awarded [<col=990000>1</col>]Npc Point!");
}
Then i tried this, with the || and it still did the same thing, only first one give's the points and sends the message
Code:
if (npcs[i].npcType == 1265 || npcs[i].npcType == 1678 || npcs[i].npcType == 117) {
c.randomPoints += 1;
c.sendMessage("You have been awarded [<col=990000>1</col>] NPC point!");
}
Then i tried it with &&, and it still didnt work, same thing, first npc gave poiints and sent message the rest didnt!...
Code:
if (npcs[i].npcType == 1265 && npcs[i].npcType == 1678 && npcs[i].npcType == 117) {
c.randomPoints += 1;
c.sendMessage("You have been awarded [<col=990000>1</col>] NPC point!");
}