Thread: WorldMessage

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 WorldMessage 
    Donator


    Join Date
    Aug 2012
    Posts
    2,449
    Thanks given
    305
    Thanks received
    447
    Discord
    .Guruu#2979
    Rep Power
    457
    Hey. I am having a small issue with sending world message for getting something. Here is the line of code i am using

    Code:
    if (c.playerKillStreak > 5 && c.playerKillStreak < 20) {
    			c.PKP += 3 + Misc.random(6);
    			c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    		}
    It gives me the pkp but won't send the world message. Any idea how i can fix this issue. thank you.
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Jun 2011
    Posts
    2,562
    Thanks given
    539
    Thanks received
    402
    Rep Power
    658
    Code:
    for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    				if (Server.playerHandler.players[i] != null) {
    					 Client c2 = (Client)Server.playerHandler.players[i];
    					c2.sendMessage("text");
    
    				}
    			}
    All the best,
    Nirvana

    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Aug 2012
    Posts
    2,449
    Thanks given
    305
    Thanks received
    447
    Discord
    .Guruu#2979
    Rep Power
    457
    Quote Originally Posted by Nirvana View Post
    Code:
    for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    				if (Server.playerHandler.players[i] != null) {
    					 Client c2 = (Client)Server.playerHandler.players[i];
    					c2.sendMessage("text");
    
    				}
    			}
    played with it but i cant seem to figure out where to place to to make it work. I tried doing this

    Code:
    if (c.playerKillStreak > 24 && Server.playerHandler.players[i] != null) {
    c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.PKP += 5 + Misc.random(9);
    but that only sends the message and not give me the Pkp. here is the full void.


    Code:
    public static void handleKillstreak(Client c) {
    		for(int i = 0; i < Server.playerHandler.players.length; i++) {
    		 Client c2 = (Client)Server.playerHandler.players[i];
    		if (c.playerKillStreak > 5 && c.playerKillStreak < 20) {
    			c.PKP += 3 + Misc.random(6);
    		}
    		if (c.playerKillStreak > 19 && c.playerKillStreak < 25) {
    			c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.PKP += 5 + Misc.random(9);
    		}
    		if (c.playerKillStreak > 24) {
    			c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.PKP += 5 + Misc.random(9);
    		}
    		//handleServerMessage(c);
    		//handlePlayerReward(c);
    		}
    	}
    Reply With Quote  
     

  4. #4  
    -Founder Off Returnofpk-


    Join Date
    Oct 2012
    Age
    24
    Posts
    659
    Thanks given
    97
    Thanks received
    211
    Rep Power
    297
    Quote Originally Posted by Project Pk View Post
    played with it but i cant seem to figure out where to place to to make it work. I tried doing this

    Code:
    if (c.playerKillStreak > 24 && Server.playerHandler.players[i] != null) {
    c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.PKP += 5 + Misc.random(9);
    but that only sends the message and not give me the Pkp. here is the full void.


    Code:
    public static void handleKillstreak(Client c) {
    		for(int i = 0; i < Server.playerHandler.players.length; i++) {
    		 Client c2 = (Client)Server.playerHandler.players[i];
    		if (c.playerKillStreak > 5 && c.playerKillStreak < 20) {
    			c.PKP += 3 + Misc.random(6);
    		}
    		if (c.playerKillStreak > 19 && c.playerKillStreak < 25) {
    			c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.PKP += 5 + Misc.random(9);
    		}
    		if (c.playerKillStreak > 24) {
    			c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.PKP += 5 + Misc.random(9);
    		}
    		//handleServerMessage(c);
    		//handlePlayerReward(c);
    		}
    	}
    here you got

    make a file called Killstreak.java

    and add this in there

    Code:
    package server.model.players.packets;
    
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import server.model.players.PlayerHandler;
    import server.Server;
    import server.event.Event;
    import server.event.EventContainer;
    import server.event.EventManager;
    import server.model.npcs.NPC;
    import server.model.npcs.NPCHandler;
    import server.model.players.Client;
    import server.util.Misc;
    
    public class Killstreak {
    
        public int playerKillStreak = 0;
    
    	  public static void handleKillstreak(Client c) {
    	  for(int i = 0; i < Server.playerHandler.players.length; i++) {
    		 Client c2 = (Client)Server.playerHandler.players[i];
    		if (c.playerKillStreak > 5 && c.playerKillStreak < 20) {
    			c.pkpPoints += 3 + Misc.random(6);
    		}
    		if (c.playerKillStreak > 19 && c.playerKillStreak < 25) {
    			c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.pkpPoints += 5 + Misc.random(9);
    		}
    		if (c.playerKillStreak > 24) {
    			c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.pkpPoints += 5 + Misc.random(9);
    		
    			}
    		}
    	}
    }
    and then go to PlayerAssistant and import this

    Code:
    import server.model.players.packets.Killstreak;
    and find this

    Code:
    public void applyDead() {
    down off that paste this

    Code:
    Killstreak.handleKillstreak(c);
    and find this

    Code:
    You have defeated
    and add this over

    Code:
    c.playerKillStreak += 1;
    enjoy
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Donator


    Join Date
    Aug 2012
    Posts
    2,449
    Thanks given
    305
    Thanks received
    447
    Discord
    .Guruu#2979
    Rep Power
    457
    Quote Originally Posted by sheepmonger View Post
    here you got

    make a file called Killstreak.java

    and add this in there

    Code:
    package server.model.players.packets;
    
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import server.model.players.PlayerHandler;
    import server.Server;
    import server.event.Event;
    import server.event.EventContainer;
    import server.event.EventManager;
    import server.model.npcs.NPC;
    import server.model.npcs.NPCHandler;
    import server.model.players.Client;
    import server.util.Misc;
    
    public class Killstreak {
    
        public int playerKillStreak = 0;
    
    	  public static void handleKillstreak(Client c) {
    	  for(int i = 0; i < Server.playerHandler.players.length; i++) {
    		 Client c2 = (Client)Server.playerHandler.players[i];
    		if (c.playerKillStreak > 5 && c.playerKillStreak < 20) {
    			c.pkpPoints += 3 + Misc.random(6);
    		}
    		if (c.playerKillStreak > 19 && c.playerKillStreak < 25) {
    			c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.pkpPoints += 5 + Misc.random(9);
    		}
    		if (c.playerKillStreak > 24) {
    			c2.sendMessage(c.playerName+" is on a killstreak of "+c.playerKillStreak+". Kill them for a reward!");
    			c.pkpPoints += 5 + Misc.random(9);
    		
    			}
    		}
    	}
    }
    and then go to PlayerAssistant and import this

    Code:
    import server.model.players.packets.Killstreak;
    and find this

    Code:
    public void applyDead() {
    down off that paste this

    Code:
    Killstreak.handleKillstreak(c);
    enjoy
    I already had all that done before just wanted that code fixed. thanks
    Reply With Quote  
     

  7. #6  
    Donator


    Join Date
    Aug 2012
    Posts
    2,449
    Thanks given
    305
    Thanks received
    447
    Discord
    .Guruu#2979
    Rep Power
    457
    also it does not work still
    Reply With Quote  
     

  8. #7  
    -Founder Off Returnofpk-


    Join Date
    Oct 2012
    Age
    24
    Posts
    659
    Thanks given
    97
    Thanks received
    211
    Rep Power
    297
    dont forgot to add this to to make the killstreak go up and not keep be on 0



    Code:
    c.playerKillStreak += 1;
    enjoy
    Reply With Quote  
     

  9. #8  
    Donator


    Join Date
    Aug 2012
    Posts
    2,449
    Thanks given
    305
    Thanks received
    447
    Discord
    .Guruu#2979
    Rep Power
    457
    Quote Originally Posted by sheepmonger View Post
    dont forgot to add this to to make the killstreak go up and not keep be on 0



    Code:
    c.playerKillStreak += 1;
    enjoy
    code doesnt announce still only gives pkp
    Reply With Quote  
     

  10. #9  
    -Founder Off Returnofpk-


    Join Date
    Oct 2012
    Age
    24
    Posts
    659
    Thanks given
    97
    Thanks received
    211
    Rep Power
    297
    Quote Originally Posted by Project Pk View Post
    code doesnt announce still only gives pkp
    add my skype and i help you
    Reply With Quote  
     

  11. #10  
    Donator


    Join Date
    Aug 2012
    Posts
    2,449
    Thanks given
    305
    Thanks received
    447
    Discord
    .Guruu#2979
    Rep Power
    457
    still need.
    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. Replies: 21
    Last Post: 05-01-2014, 02:26 PM
  2. WorldMessage
    By Traxar in forum Help
    Replies: 11
    Last Post: 08-29-2013, 02:19 PM
  3. 718 [Matrix] Worldmessage for new starters
    By Savions in forum Tutorials
    Replies: 20
    Last Post: 11-24-2012, 09:58 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
  •