Thread: [PI] need help changing yell command to donaters only.

Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1 [PI] need help changing yell command to donaters only. 
    Registered Member
    Join Date
    Jun 2010
    Posts
    73
    Thanks given
    6
    Thanks received
    0
    Rep Power
    1
    If anyone can tell me how to change the yell command in my server to donater only, I would really like to change so new people can't spam the yell chat also players that like to advertise can't do it in yell thanks
    Reply With Quote  
     

  2. #2  
    Registered Member Flashy's Avatar
    Join Date
    Apr 2011
    Posts
    162
    Thanks given
    9
    Thanks received
    3
    Rep Power
    37
    Well post your yell command.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jun 2010
    Posts
    73
    Thanks given
    6
    Thanks received
    0
    Rep Power
    1
    Where would it be located? I do this ingame ::yell.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Aug 2009
    Age
    30
    Posts
    69
    Thanks given
    5
    Thanks received
    3
    Rep Power
    1
    for pi src/server/model/players/packets/commands search for "yell" copy what it says under it and paste it on here not EVERYTHING UNDER IT just the yell part
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jun 2010
    Posts
    73
    Thanks given
    6
    Thanks received
    0
    Rep Power
    1
    Spoiler for First one I ran into:
    if (playerCommand.equalsIgnoreCase("commands")) {
    c.getPA().showInterface(8134);
    c.getPA().sendFrame126("@red@~ XRealm Light Commands ~",8144);
    c.getPA().sendFrame126("@cya@All commands have a :: infront of it",8145);
    c.getPA().sendFrame126("@red@yell ",8146);
    c.getPA().sendFrame126("@gre@All Reset Commands",8147);
    c.getPA().sendFrame126("@gre@changepassword",8148) ;
    c.getPA().sendFrame126("@gre@::kdr",8149);
    c.getPA().sendFrame126("@gre@::rest",8150);
    c.getPA().sendFrame126("@gre@::fpp",8151);
    c.getPA().sendFrame126("@gre@::rules",8152);
    c.getPA().sendFrame126("@gre@::report",8153);
    c.getPA().sendFrame126("@gre@::corp",8154);
    c.getPA().sendFrame126("@gre@::train",8155);
    c.getPA().sendFrame126("@gre@::home",8155);
    }



    Spoiler for Second one:
    if (playerCommand.startsWith("yell")) {
    /*
    *This is the sensor for the yell command
    */
    /*String text = playerCommand.substring(5);
    String[] bad = {"chalreq", "duelreq", "tradereq", ". com", "c0m", "com",
    "org", "net", "biz", ". net", ". org", ". biz",
    ". no-ip", "- ip", ".no-ip.biz", "no-ip.org", "servegame",
    ".com", ".net", ".org", "no-ip", "****", "is gay", "****",
    "crap", "rubbish", ". com", ". serve", ". no-ip", ". net", ". biz"};
    for(int i = 0; i < bad.length; i++){
    if(text.indexOf(bad[i]) >= 0){
    return;
    }

    --------------------------------------------------------------------------------------------
    Do i change this


    for(int i = 0; i < bad.length; i++){
    if(text.indexOf(bad[i]) >= 0){
    return;

    to this?


    for(int i = 0; i < bad.length; i++){
    if(text.indexOf(bad[i]) >= 4){
    return;
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Aug 2011
    Posts
    2,760
    Thanks given
    297
    Thanks received
    534
    Rep Power
    1596
    heres one
    Code:
    }else if (c.isDonator == 0) {
    								c.sendMessage("You must be a donator to use this command!");
    or
    Code:
    }else if (c.playerRights == 0) {
    								c.sendMessage("You must be a donator to use this command!");
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2009
    Age
    30
    Posts
    69
    Thanks given
    5
    Thanks received
    3
    Rep Power
    1
    if (playerCommand.startsWith("yell")) {

    you need to declare the player rights

    just try replacing yours with this

    if (playerCommand.startsWith("yell")) {
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    if (Server.playerHandler.players[j] != null) {
    Client c2 = (Client)Server.playerHandler.players[j];
    if(c.playerRights == 6){
    c.sendMessage("Yell channel has been disabled for players.");
    return;
    }
    //switch (c.playerRights){
    //case 0:
    //c2.sendMessage("<col=255>[Player]</col>"+Misc.optimizeText(c.playerName)+": "
    //+ Misc.optimizeText(playerCommand.substring(5))+"");
    //break;
    case 1:
    c2.sendMessage("<col=255>[Mod]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    case 2:
    c2.sendMessage("<col=255>[Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    case 3:
    c2.sendMessage("<shad=15695415>[Super Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    case 4:
    c2.sendMessage("<shad=15695415>[Owner/Developer]</col><img=3>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    case 5:
    c2.sendMessage("<shad=6081134>[Donator]</col><img=5>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    }
    }
    }
    }
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jun 2010
    Posts
    73
    Thanks given
    6
    Thanks received
    0
    Rep Power
    1
    Spikey where I put them in?

    And rdwuestewald would this mess up any of my commands?
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Aug 2011
    Posts
    2,760
    Thanks given
    297
    Thanks received
    534
    Rep Power
    1596
    Quote Originally Posted by rdwuestewald View Post
    if (playerCommand.startsWith("yell")) {

    you need to declare the player rights

    just try replacing yours with this

    if (playerCommand.startsWith("yell")) {
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    if (Server.playerHandler.players[j] != null) {
    Client c2 = (Client)Server.playerHandler.players[j];
    if(c.playerRights == 6){
    c.sendMessage("Yell channel has been disabled for players.");
    return;
    }
    //switch (c.playerRights){
    //case 0:
    //c2.sendMessage("<col=255>[Player]</col>"+Misc.optimizeText(c.playerName)+": "
    //+ Misc.optimizeText(playerCommand.substring(5))+"");
    //break;
    case 1:
    c2.sendMessage("<col=255>[Mod]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    case 2:
    c2.sendMessage("<col=255>[Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    case 3:
    c2.sendMessage("<shad=15695415>[Super Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    case 4:
    c2.sendMessage("<shad=15695415>[Owner/Developer]</col><img=3>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    case 5:
    c2.sendMessage("<shad=6081134>[Donator]</col><img=5>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    break;
    }
    }
    }
    }
    all you did was copy the shitty code out of your server and you DIDNT even fix his problem because in this yell reg. players can yell.

    Quote Originally Posted by chris2244 View Post
    Spikey where I put them in?

    And rdwuestewald would this mess up any of my commands?
    ill just put up my yell command then;
    Code:
    if (playerCommand.startsWith("yell")) {
    					/*
    					*This is the sensor for the yell command
    					*/
    					String text = playerCommand.substring(5);
    					String[] bad = {"<img=1>", "<img=2>", "<img=0>"};
    					for(int i = 0; i < bad.length; i++){
    						if(text.indexOf(bad[i]) >= 0){
    							return;
    						}
    					}
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
    						
    							
    							if (c.playerName.equalsIgnoreCase("")) {
    								c2.sendMessage("[custom title]"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}else if (c.isDonator == 1 && (c.playerRights == 4 )) {
    								c2.sendMessage("[Donator]"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}else if (c.playerRights == 1) {
    								c2.sendMessage("[Moderator]"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}else if (c.playerRights == 2) {
    								c2.sendMessage("[Administrator]"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");					
    							}else if (c.playerRights == 3) {
    								c2.sendMessage("[Owner]"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							}}else if (c.playerRights == 0) {
    								c.sendMessage("You must be a donator to use this command!");					
    									
    							}
    						}
    					}
    				}
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Jun 2010
    Posts
    73
    Thanks given
    6
    Thanks received
    0
    Rep Power
    1
    How should I do this then?
    Reply With Quote  
     

Page 1 of 3 123 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: 50
    Last Post: 04-17-2014, 02:19 PM
  2. Anyone have PI yell command
    By HiImRusty in forum Help
    Replies: 1
    Last Post: 06-14-2010, 08:00 PM
  3. ::yell command
    By Bestia in forum Help
    Replies: 7
    Last Post: 12-18-2009, 02:32 AM
  4. New ::yell Command
    By i_own_sheep in forum Snippets
    Replies: 13
    Last Post: 09-09-2009, 06:56 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •