|
I'm new to coding and trying to understand how the servers work. I'm in progress of making a quest and I found how to disable walking, but when you click on a npc to attack, the player will walk to it and engage in combat. I want to disable this alltogether.
I tried putting something along the lines of
in combatAssistant.java, clickNPC.java and attackNPC.java and I never got any errors but it just didn't work.Code:if(c.combatEnabled = true) { //do sheyt }
I really felt that it should work here but it didn't. Attacknpc.java
What am I doing wrong here? I'm still a total noob at this, sry if it's a stupid question.Code:public static void attackNpc(Client c, int i) { if (NPCHandler.npcs[i] != null) { if (NPCHandler.npcs[i].isDead || NPCHandler.npcs[i].MaxHP <= 0) { c.usingMagic = false; c.faceUpdate(0); c.npcIndex = 0; return; } if(c.respawnTimer > 0) { c.npcIndex = 0; return; } if (NPCHandler.npcs[i].underAttackBy > 0 && NPCHandler.npcs[i].underAttackBy != c.playerId && !NPCHandler.npcs[i].inMulti()) { c.npcIndex = 0; c.sendMessage("This monster is already in combat."); return; if(c.combatEnabled = false) { c.sendMessage("You cannot fight right now"); return; }
QUESTION 2
I edited the text of a quest and figured out how to make it change colors depending on the stage of the quest, but when you move to the next stage you need to relog for the color to update (red to yellow i.e.). Is this a client error? How can I make the text update instantly?
Thank you.
All you need to do is when you progress for the first time in the quest (when it should change yellow for the first time) where ever you change the quest stage add something like(sendquest/sendstring/sendframe126 - idk anymore)And do the same for when you finish the quest but of course make the text green.Code:sendString("@yel@quest", id);
However if you're like me and find the hover-colour important you can find a nice thread here - http://www.rune-server.org/runescape...ver-color.html
No, it's not identical. The symbol '=' is for assignment, where as the conjunction of symbols '==' is used for determining equivalency.
Code:boolean combatEnabled = true; //correct because we are initializing a class memberCode:boolean combatEnabled == true; //incorrect because we're initialize, not comparingCode:if (combatEnabled == true) //correct because we're comparing the state of the variable to that of trueCode:if (combatEnabled = true) //incorrect because we're comparing, not assigning
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |