Thread: Confused on how to do this

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 Confused on how to do this 
    Donator
    Defiled-X's Avatar
    Join Date
    Jun 2010
    Posts
    1,434
    Thanks given
    52
    Thanks received
    78
    Rep Power
    27
    Code:
    	public void applyDead() {	
    		c.respawnTimer = 15;
    		c.isDead = false;
    		
    if(c.duelStatus != 6) {
    			//c.killerId = c.getCombat().getKillerId(c.playerId);
    			c.killerId = findKiller();
    			Client o = (Client) Server.playerHandler.players[c.killerId];
    			if(o != null) {
    				if(!(c.npcIndex > 0) && c.inPits == false){
    				}
    				if (c.killerId != c.playerId)
    					o.sendMessage("You have defeated "+Misc.optimizeText(c.playerName)+"!");
    					c.playerKilled = c.playerId;
    				if(!PlayerKilling.hostOnList(o, c.connectedFrom)) {
    					PlayerKilling.addHostToList(o, c.connectedFrom);
    					o.pcPoints++;
    					o.sendMessage("You have received a point, you now have "+o.pcPoints+" pk points.");
    					} else {
    					o.sendMessage("You have recently defeated "+c.playerName+", you don't receive any pk points.");
    					}
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    			}
    		}
    That is part of my applyDead() - I want to make it so that if the player gets points for killing, he has to be in the wildy. Otherwise he doesn't
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Feb 2012
    Posts
    368
    Thanks given
    24
    Thanks received
    26
    Rep Power
    14
    Code:
    if (c.inWild())
    Code:
    if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {
    					c.pcPoints += 5;
    					o.sendMessage("You recieved 5 PEP");
    					o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
    				} else {
    					o.sendMessage("You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    				}
    			}
    		}
    I've basically spoonfed you here, Put the inWild code somewhere in here, if you cant figure that out then :\

    you'll need to change the points variable to yours.
    Reply With Quote  
     

  3. #3  
    Donator
    Defiled-X's Avatar
    Join Date
    Jun 2010
    Posts
    1,434
    Thanks given
    52
    Thanks received
    78
    Rep Power
    27
    I had the same applyDead() its from Project-Explicity - It didn't work for me lol. But uhm would it go something like this?

    Code:
    if(!(c.npcIndex > 0) && c.inPits == false){
    				}
    				if (c.killerId != c.playerId)
    					o.sendMessage("You have defeated "+Misc.optimizeText(c.playerName)+"!");
    					c.playerKilled = c.playerId;
    				if(!PlayerKilling.hostOnList(o, c.connectedFrom)) {
    					PlayerKilling.addHostToList(o, c.connectedFrom);
                                            If(c.inWild()) {
    					o.pcPoints++;
    					o.sendMessage("You have received a point, you now have "+o.pcPoints+" pk points.");
    					} else {
    					o.sendMessage("You have recently defeated "+c.playerName+", you don't receive any pk points.");
    					}
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    			}
    		}
    I don't know anywhere else and where i just put it gives me 100 errors
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    May 2011
    Posts
    1,010
    Thanks given
    78
    Thanks received
    64
    Rep Power
    0
    Quote Originally Posted by Defiled-X View Post
    I had the same applyDead() its from Project-Explicity - It didn't work for me lol. But uhm would it go something like this?

    Code:
    if(!(c.npcIndex > 0) && c.inPits == false){
    				}
    				if (c.killerId != c.playerId)
    					o.sendMessage("You have defeated "+Misc.optimizeText(c.playerName)+"!");
    					c.playerKilled = c.playerId;
    				if(!PlayerKilling.hostOnList(o, c.connectedFrom)) {
    					PlayerKilling.addHostToList(o, c.connectedFrom);
                                            If(c.inWild()) {
    					o.pcPoints++;
    					o.sendMessage("You have received a point, you now have "+o.pcPoints+" pk points.");
    					} else {
    					o.sendMessage("You have recently defeated "+c.playerName+", you don't receive any pk points.");
    					}
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    			}
    		}
    I don't know anywhere else and where i just put it gives me 100 errors
    lol? you do know 100 errors is probably a brasket
    Code:
    if(!(c.npcIndex > 0) && c.inPits == false){
    				
    				if (c.killerId != c.playerId) {
    					o.sendMessage("You have defeated "+Misc.optimizeText(c.playerName)+"!");
    					c.playerKilled = c.playerId;
    				if(c.inWild()) {
    				if(!PlayerKilling.hostOnList(o, c.connectedFrom)) {
    					PlayerKilling.addHostToList(o, c.connectedFrom);
    					o.pcPoints++;
    					o.sendMessage("You have received a point, you now have "+o.pcPoints+" pk points.");
    					} else {
    					o.sendMessage("You have recently defeated "+c.playerName+", you don't receive any pk points.");
    					}
    					}
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    			}
    			}
    			}
    try that
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2012
    Posts
    368
    Thanks given
    24
    Thanks received
    26
    Rep Power
    14
    Quote Originally Posted by Defiled-X View Post
    I had the same applyDead() its from Project-Explicity - It didn't work for me lol. But uhm would it go something like this?

    Code:
    if(!(c.npcIndex > 0) && c.inPits == false){
    				}
    				if (c.killerId != c.playerId)
    					o.sendMessage("You have defeated "+Misc.optimizeText(c.playerName)+"!");
    					c.playerKilled = c.playerId;
    				if(!PlayerKilling.hostOnList(o, c.connectedFrom)) {
    					PlayerKilling.addHostToList(o, c.connectedFrom);
                                            If(c.inWild()) {
    					o.pcPoints++;
    					o.sendMessage("You have received a point, you now have "+o.pcPoints+" pk points.");
    					} else {
    					o.sendMessage("You have recently defeated "+c.playerName+", you don't receive any pk points.");
    					}
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    			}
    		}
    I don't know anywhere else and where i just put it gives me 100 errors
    Yes It's in the right spot.

    Code:
    if(o.duelStatus == 5) {
    					o.duelStatus++;
    Code:
    if(c.duelStatus != 6) {
    			//c.killerId = c.getCombat().getKillerId(c.playerId);
    			c.killerId = findKiller();
    			Client o = (Client) Server.playerHandler.players[c.killerId];
    			if(o != null) {
    c.playerKilled = c.playerId;
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    The part i Highlighted, Not sure if you need that part, but i do for mine so if u get errors change it.

    P.s I moved the
    Code:
    if(o.duelStatus == 5) {
    					o.duelStatus++;
    If you dont understand what i'm doing lol





    So it'd look something like this --
    DONT Copy as this is my applyDead but just giving you an example

    Code:
    if(c.duelStatus != 6) {
    			c.killerId = findKiller();
    			if(o != null) {
    				c.playerKilled = c.playerId;
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    				if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {
    					c.pcPoints += 5;
    					o.sendMessage("You recieved 5 PEP");
    					o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
    				} else {
    					o.sendMessage("You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    				}
    			}
    		}


    Quote Originally Posted by yonacool View Post
    lol? you do know 100 errors is probably a brasket
    Code:
    if(!(c.npcIndex > 0) && c.inPits == false){
    				
    				if (c.killerId != c.playerId) {
    					o.sendMessage("You have defeated "+Misc.optimizeText(c.playerName)+"!");
    					c.playerKilled = c.playerId;
    				if(c.inWild()) {
    				if(!PlayerKilling.hostOnList(o, c.connectedFrom)) {
    					PlayerKilling.addHostToList(o, c.connectedFrom);
    					o.pcPoints++;
    					o.sendMessage("You have received a point, you now have "+o.pcPoints+" pk points.");
    					} else {
    					o.sendMessage("You have recently defeated "+c.playerName+", you don't receive any pk points.");
    					}
    					}
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    			}
    			}
    			}
    try that
    all you did was put the brackets in a line that's not going to solve anything...
    Reply With Quote  
     

  6. #6  
    Donator
    Defiled-X's Avatar
    Join Date
    Jun 2010
    Posts
    1,434
    Thanks given
    52
    Thanks received
    78
    Rep Power
    27
    That's the original applydead() method of that server. that one didn't let your character let you die. That is why i changed and why i have to do this. So you didn't really answer my question.

    How do i add in if(c.inWild()) to that code so it makes the player get points only when he is in the wildy


    Look this is the original method -

    Code:
    public void applyDead() {
    	if (c.indungboss == true) {
    	c.indungboss = false;
    	}
    				c.killerId = findKiller();
    			Client o = (Client) Server.playerHandler.players[c.killerId];
    		if (c.inZaros()) {
    		c.MinionsToKill = 0;
    		}
    		c.respawnTimer = 15;
    		c.isDead = false;
    		if(c.duelStatus != 6) {
    			c.killerId = findKiller();
    			if(o != null) {
    				c.playerKilled = c.playerId;
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    				if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {
    					c.pcPoints += 5;
    					o.sendMessage("You recieved 5 PEP");
    					o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
    				} else {
    					o.sendMessage("You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    				}
    			}
    		}
    		c.faceUpdate(0);
    		c.npcIndex = 0;
    		c.playerIndex = 0;
    		c.stopMovement();
    					if (c.duelStatus <= 4) {
    				c.sendMessage("Oh dear you are dead!");
    			} else if(c.duelStatus != 6 || !c.inArena()) {
    				c.sendMessage("You have lost the duel!");
    				/*o.getPA().movePlayer(
    						Config.DUELING_RESPAWN_X
    								+ (Misc.random(Config.RANDOM_DUELING_RESPAWN)),
    						Config.DUELING_RESPAWN_Y
    								+ (Misc.random(Config.RANDOM_DUELING_RESPAWN)), 0);*/
    			}
    		resetDamageDone();
    		c.DC++;
    		o.KC++;	
    		c.specAmount = 10;
    		c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]);
    		c.lastVeng = 0;
    		c.vengOn = false;
    		resetFollowers();
    		c.attackTimer = 10;
    		if (Server.playerHandler.players[c.killerId].connectedFrom.equals(Server.playerHandler.players[c.playerKilled].connectedFrom)) {
    					o.sendMessage("You Don't Recieve PK Points for killing yourself!");
    		c.faceUpdate(0);
    		c.npcIndex = 0;
    		c.playerIndex = 0;
    		c.stopMovement();
    		if(c.duelStatus <= 4) {
    			c.sendMessage("Oh dear you are dead!");
    		} else if(c.duelStatus != 6) {
    			c.sendMessage("You have lost the duel!");
    		}
    		resetDamageDone();
    		c.lastVeng = 0;
    		c.vengOn = false;
    		resetFollowers();
    		c.attackTimer = 10;
    		removeAllWindows();
    		c.tradeResetNeeded = true;
    		return;
    		}
    	}
    
    	public void resetDamageDone() {
    		for (int i = 0; i < PlayerHandler.players.length; i++) {
    			if (PlayerHandler.players[i] != null) {
    				PlayerHandler.players[i].damageTaken[c.playerId] = 0;
    			}
    		}
    	}
    That code wouldn't allow my character to die. This new one is giving me points when i die to monsters
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Feb 2012
    Posts
    368
    Thanks given
    24
    Thanks received
    26
    Rep Power
    14
    Code:
    if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {
    				if (o.inWild())
    					c.pcPoints += 5;
    					o.sendMessage("You recieved 5 PEP");
    					o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
    				} else {
    					o.sendMessage("You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    				}
    Change accordingly.

    Code:
    if(!PlayerKilling.hostOnList(o, c.connectedFrom)) {
    					PlayerKilling.addHostToList(o, c.connectedFrom);
    				if (o.inWild())
    					o.pcPoints++;
    					o.sendMessage("You recieved 5 PEP");
    				} else {
    					o.sendMessage("You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    				}
    Changed it for you might need to edit it a little bit.
    Reply With Quote  
     

  8. #8  
    Donator
    Defiled-X's Avatar
    Join Date
    Jun 2010
    Posts
    1,434
    Thanks given
    52
    Thanks received
    78
    Rep Power
    27
    Does your applyDead() Method work properly? And let your character Die?
    If so can you post it?
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Feb 2012
    Posts
    368
    Thanks given
    24
    Thanks received
    26
    Rep Power
    14
    Quote Originally Posted by Defiled-X View Post
    Does your applyDead() Method work properly? And let your character Die?
    If so can you post it?
    Code:
    public void applyDead() {
    	if (c.indungboss == true) {
    	c.indungboss = false;
    	}
    				c.killerId = findKiller();
    			Client o = (Client) Server.playerHandler.players[c.killerId];
    		if (c.inZaros()) {
    		c.MinionsToKill = 0;
    		}
    		c.respawnTimer = 15;
    		c.isDead = false;
    		if(c.duelStatus != 6) {
    			c.killerId = findKiller();
    			if(o != null) {
    				c.playerKilled = c.playerId;
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    				if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {
    				if (o.inWild())
    					c.pcPoints += 5;
    					o.sendMessage("You recieved 5 PEP");
    					o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
    				} else {
    					o.sendMessage("You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    				}
    			}
    		}
    I doubt it's goign to work because it seems your source is using the tutorial where you make a folder called PlayerKilling.java etc

    But w.e here u go, p.s remove the dung and stuff.
    Reply With Quote  
     

  10. #10  
    Banned
    Join Date
    May 2011
    Posts
    1,010
    Thanks given
    78
    Thanks received
    64
    Rep Power
    0
    Quote Originally Posted by Deception-pkz View Post
    Yes It's in the right spot.

    Code:
    if(o.duelStatus == 5) {
    					o.duelStatus++;
    Code:
    if(c.duelStatus != 6) {
    			//c.killerId = c.getCombat().getKillerId(c.playerId);
    			c.killerId = findKiller();
    			Client o = (Client) Server.playerHandler.players[c.killerId];
    			if(o != null) {
    c.playerKilled = c.playerId;
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    The part i Highlighted, Not sure if you need that part, but i do for mine so if u get errors change it.

    P.s I moved the
    Code:
    if(o.duelStatus == 5) {
    					o.duelStatus++;
    If you dont understand what i'm doing lol





    So it'd look something like this --
    DONT Copy as this is my applyDead but just giving you an example

    Code:
    if(c.duelStatus != 6) {
    			c.killerId = findKiller();
    			if(o != null) {
    				c.playerKilled = c.playerId;
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    				if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {
    					c.pcPoints += 5;
    					o.sendMessage("You recieved 5 PEP");
    					o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
    				} else {
    					o.sendMessage("You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    				}
    			} 
    		}




    all you did was put the brackets in a line that's not going to solve anything...
    did you even look at his code?? look be4 you say something
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Confused
    By rockarocka in forum Help
    Replies: 1
    Last Post: 08-23-2010, 10:13 AM
  2. Very confused....
    By Master Of RuneServer in forum Help
    Replies: 24
    Last Post: 06-03-2010, 12:48 AM
  3. how would i im a little confused
    By Dr Satan in forum Help
    Replies: 1
    Last Post: 04-23-2009, 08:09 PM
  4. Confused.
    By Jean in forum Help
    Replies: 2
    Last Post: 01-21-2009, 02:01 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •