Thread: [PI] Killstreak System 100%

Page 2 of 12 FirstFirst 1234 ... LastLast
Results 11 to 20 of 115
  1. #11  
    ~! Legit ~!

    Join Date
    Nov 2010
    Posts
    1,973
    Thanks given
    183
    Thanks received
    211
    Rep Power
    237
    They way he did it is fine
    Code:
    		if (Server.playerHandler.players[j] != null) {
    				Client c2 = (Client)Server.playerHandler.players[j];
    				c2.sM(msg);
    				}
    I dont see any change? lol
    [email protected]
    Spoiler for My Vouches:
    Quote Originally Posted by mattsforeal View Post
    I paid $5 went first, he fixed my problem and it worked. 100% legit would do it again.
    Quote Originally Posted by Mythic View Post
    Vouch for him, very smooth and fast trade, purchased his last 4m. Have fun with your new membership
    Quote Originally Posted by Harlan View Post
    Vouch, trustworthy guy.
    Quote Originally Posted by iPhisher™ View Post
    Vouch for Super-Man, he is a very legit and trustable guy.
    Reply With Quote  
     

  2. #12  
    Banned
    Join Date
    Nov 2011
    Age
    31
    Posts
    430
    Thanks given
    22
    Thanks received
    66
    Rep Power
    0
    Amazing just implemented it shoudent of released tho all the e noobs will get lol but thanks
    Reply With Quote  
     

  3. #13  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    Quote Originally Posted by SLayRz View Post
    Amazing just implemented it shoudent of released tho all the e noobs will get lol but thanks
    lets not say this is *that* good of a release...

    ot: gj, simple thou...
    Reply With Quote  
     

  4. #14  
    Registered Member Kota Ko's Avatar
    Join Date
    Aug 2009
    Age
    26
    Posts
    1,040
    Thanks given
    39
    Thanks received
    61
    Rep Power
    39
    Quote Originally Posted by Glucoma View Post
    Your conventions are not the best, here you got

    Code:
    		public void yell(String msg) {
    			for (int j = 0; j < Server.playerHandler.players.length; j++) {
    				if (Server.playerHandler.players[j] != null) {
    				Client c2 = (Client)Server.playerHandler.players[j];
    				c2.sM(msg);
    				}
    			}	
    		}
    The problem with that is

    Code:
    				if (Server.playerHandler.players[j] != null) {
    				Client c2 = (Client)Server.playerHandler.players[j];
    				c2.sM(msg);
    				}
    It should be
    Code:
    				if (Server.playerHandler.players[j] != null) {
    				Client c2 = (Client)Server.playerHandler.players[j];
    				c2.sM(msg);
    				}
    And some other minor stuff but I probably am wrong and you know conventions and it's just the stupid post that ruins the conventions.

    The code can be done more simply such as the switch statement. Also you indent once before the code not twice.

    Code:
    package server.model.players.contents;
    
    import server.model.players.Client;
    import server.Server;
    import server.model.players.PlayerHandler;
    import server.model.players.Player;
    
    /**
     * Killing Streak System
     * 
     * @author Dakota Chest
     */
    
    public class KillingStreak {
    
    	/**
    	 * The player
    	 * 
    	 */
    	private Client c;
    
    	public KillingStreak(Client c) {
    		this.c = c;
    	}
    
    	/**
    	 * Max possible killstreak reward
    	 */
    	private final int MAX_KILLSTREAK = 7;
    	
    	/**
    	* Sends the message throughout the server
    	*/
    		
    	public void yell(String msg) {
    		for (int j = 0; j < Server.playerHandler.players.length; j++) {
    			if (Server.playerHandler.players[j] != null) {
    			Client c2 = (Client)Server.playerHandler.players[j];
    				c2.sM(msg);
    			}
    		}	
    	}
    		
    	/**
    	* Add rewards to the player who died
    	* with the kill streak
    	* 
    	*/
    		
    	public void Rewards() {
    		Client o = (Client) PlayerHandler.players[c.killerId];
    		if (o.killStreak > 1 && o.killStreak < MAX_KILLSTREAK) {
    			c.getItems().addItem(995, 1000000 * o.killStreak);
    		}
    	}
    		
    	/**
    	* Checks the player if they have
    	* a killstreak of 2 or more
    	* can add on
    	* 
    	*/
    		
    	public void checkKillStreak() {
    		yell("@red@PvP System:@bla@ "+c.playerName+", is on a killing streak of "+c.killStreak+", Bounty: "+c.killStreak+"M!");		
    	}
    
    	/**
    	* Checks if the player with the killstreak
    	* died add items to the killer
    	* 
    	*/	
    			
    	public void killedPlayer() {
    		Client o = (Client) PlayerHandler.players[c.killerId];
    			if (o.killStreak >= 2 || c.killerId != o.playerId) {
    				yell("@red@PvP System:@bla@ "+c.playerName+" has ended "+o.playerName+" killing streak of "+o.killStreak+", and was rewarded.");
    				Rewards();
    			}
    		}	  
    	}
    I know about my conventions I'm a little rusty...but to be honest I don't care if you don't wanna use don't I'm not forcing you to use it...also I did it my way
    Reply With Quote  
     

  5. #15  
    Registered Member
    Join Date
    Sep 2011
    Posts
    31
    Thanks given
    0
    Thanks received
    17
    Rep Power
    18
    Quote Originally Posted by Dakota Chest View Post
    I know about my conventions I'm a little rusty...but to be honest I don't care if you don't wanna use don't I'm not forcing you to use it...also I did it my way
    So your way is the inefficient way of programming. Great. You do that.
    < LOL
    Reply With Quote  
     

  6. #16  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    what's the point of having it instanced for every player if you don't even hold the killstreak values in there

    lot's of convention problems but if you don't care for learning not going to bother correcting them

    nice share though
    Reply With Quote  
     

  7. #17  
    Registered Member Kota Ko's Avatar
    Join Date
    Aug 2009
    Age
    26
    Posts
    1,040
    Thanks given
    39
    Thanks received
    61
    Rep Power
    39
    Quote Originally Posted by Harlan View Post
    what's the point of having it instanced for every player if you don't even hold the killstreak values in there

    lot's of convention problems but if you don't care for learning not going to bother correcting them

    nice share though
    Cba right now just a basic killstreak just implement...
    Reply With Quote  
     

  8. #18  
    Registered Member
    Join Date
    May 2011
    Posts
    114
    Thanks given
    10
    Thanks received
    1
    Rep Power
    2
    What do you do if your source doesn't have ...
    Code:
    o.sendMessage(getKM());
    In it's PlayerAssistant.java .....?
    Help would be nice! xD
    Reply With Quote  
     

  9. #19  
    Registered Member
    Join Date
    Dec 2011
    Posts
    109
    Thanks given
    20
    Thanks received
    4
    Rep Power
    13
    Max killstreak seven? What, do you get harrier?
    Reply With Quote  
     

  10. #20  
    Registered Member Kota Ko's Avatar
    Join Date
    Aug 2009
    Age
    26
    Posts
    1,040
    Thanks given
    39
    Thanks received
    61
    Rep Power
    39
    Quote Originally Posted by Pyroz View Post
    What do you do if your source doesn't have ...
    Code:
    o.sendMessage(getKM());
    In it's PlayerAssistant.java .....?
    Help would be nice! xD
    Just look for you kill death message in PlayerAssistant under the applyDead method
    Reply With Quote  
     

Page 2 of 12 FirstFirst 1234 ... 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. [PI]Simple Killstreak Titles
    By Arithium in forum Snippets
    Replies: 27
    Last Post: 02-26-2012, 06:11 PM
  2. [PI]Killstreak Notification[PI]
    By thatsgodzkill in forum Help
    Replies: 9
    Last Post: 11-23-2011, 12:47 AM
  3. [PI]Killstreak Help[PI]
    By thatsgodzkill in forum Help
    Replies: 4
    Last Post: 11-15-2011, 03:17 AM
  4. Secret Nuke Killstreak in MW3 (M.O.A.B)
    By Impervious in forum Spam
    Replies: 16
    Last Post: 11-14-2011, 12:36 AM
  5. [pi] killStreak help
    By MetalGear in forum Help
    Replies: 0
    Last Post: 09-10-2010, 10:33 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
  •