Well post your yell command.
|
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
Well post your yell command.
Where would it be located? I do this ingame ::yell.
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
Spoiler for First one I ran into:
Spoiler for Second one:
--------------------------------------------------------------------------------------------
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;
heres oneorCode:}else if (c.isDonator == 0) { c.sendMessage("You must be a donator to use this command!");Code:}else if (c.playerRights == 0) { c.sendMessage("You must be a donator to use this command!");
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;
}
}
}
}
Spikey where I put them in?
And rdwuestewald would this mess up any of my commands?
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.
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!"); } } } }
How should I do this then?
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |