PDA

View Full Version : Setting up names for persons in yell



estrangeftw
June 24th, 2010, 13:22
codeusa base im trying to find out how do i get ppl names in yell example:
[owner]son: yo
[servchat w/e it is]player:hi

pretty much what i mean is i want to give personal names in yell for some persons how do i do that?

and also i cant kick/jail/mute how can i fix dat?[staff]

Wise Old Man
June 24th, 2010, 18:59
if(p.username.equalsIgnorecase("son"){

ace
July 3rd, 2010, 22:33
okay well, this is my yell command, if you would like to use it and change it around abit, btw it's in the commands.java file in the source.


if (cmd[0].equals("yell")) {
for (Player pl : Server.engine.players) {
if (pl != null) {
if (p.muteType > 0) {
p.getActionSender().sendMessage(p, "You are muted and cannot yell until an administrator unmutes you.");
return;
}
if (playerCommand.equals("ace") || playerCommand.equals("jiglojay"))
return;
if (p.rights == 0)
pl.getActionSender().sendMessage(pl, " <col=FF0000>[Owner]<img=1>" + p.username + ": " + playerCommand.substring(5));
else if (p.rights == 1)
pl.getActionSender().sendMessage(pl, " <col=ff0000><img=2> [Deathsorrow pvp]<img=0>[Mod] " + p.username + ": " + playerCommand.substring(5));
else if (p.rights >= 2)
pl.getActionSender().sendMessage(pl, " <col=11669900>[Deathsorrow pvp]" + p.username + ": " + playerCommand.substring(5));
pl.getActionSender().sendMessage(pl, " <col=11669900>[Deathsorrow pvp]" + p.username + ": " + playerCommand.substring(5));

}
}
}

Spherix
July 4th, 2010, 00:12
if (command.startsWith("yell") && command.length() > 5 && playerRights >= 0) {
String titles = "";

if (donator >= 1) {
titles = "[Donor] ";
}
if (playerRights == 0) {
titles = "[Player] ";
}
if (playerRights == 1) {
titles = "[Moderator] ";
}

if (playerName.equalsIgnoreCase("Spherix")) {
titles = "[GOD OF HELL]-";
}
talk(titles + "" + playerName + ": "
+ command.substring(5));



talk(titles + "" + playerName + ": " talk can be different for some servers,



Just add a new name for Spherix and add a new title for GOD OF HELL, or add more of the if commands to do multiple players, thats my whole yell command, i hope this helps im fairly new to coding

Super
July 4th, 2010, 00:26
if (command.startsWith("yell") && command.length() > 5 && playerRights >= 0) {
String titles = "";

if (donator >= 1) {
titles = "[Donor] ";
}
if (playerRights == 0) {
titles = "[Player] ";
}
if (playerRights == 1) {
titles = "[Moderator] ";
}

if (playerName.equalsIgnoreCase("Spherix")) {
titles = "[GOD OF HELL]-";
}
talk(titles + "" + playerName + ": "
+ command.substring(5));


talk can be different for some servers,



Just add a new name for Spherix and add a new title for GOD OF HELL, or add more of the if commands to do multiple players, thats my whole yell command, i hope this helps im fairly new to coding

Isnt that for 317?

Spherix
July 4th, 2010, 02:11
yes, and you can call me stupid, sorry about that lmao

Zero Mercy
July 4th, 2010, 02:29
As for this topic, please use the search function next time. Tehcow made a tutorial for this.



if (command.startsWith("yell") && command.length() > 5 && playerRights >= 0) {
String titles = "";

if (donator >= 1) {
titles = "[Donor] ";
}
if (playerRights == 0) {
titles = "[Player] ";
}
if (playerRights == 1) {
titles = "[Moderator] ";
}

if (playerName.equalsIgnoreCase("Spherix")) {
titles = "[GOD OF HELL]-";
}
talk(titles + "" + playerName + ": "
+ command.substring(5));


talk can be different for some servers,



Just add a new name for Spherix and add a new title for GOD OF HELL, or add more of the if commands to do multiple players, thats my whole yell command, i hope this helps im fairly new to coding

Idk if Codeusa's source is 317 or 508+, but here is this command just with switches and more stuff.

if (command.startsWith("yell") && command.length() > 5) {
String titles = "";
switch(donator) {
case 1:
titles = "[Donor] "; break;
}
switch(playerRights) {
case 0:
titles = "[Player] "; break;
case 1:
titles = "[Moderator] "; break;
case 2:
titles = "[Administrator] "; break;
case 3:
titles = "[Owner] "; break;
}
yell(titles + "" + playerName + ": "
+ command.substring(5));
}

I learned my switches from the Java tutorial, so if it's ugly sorry.
If your co-owners are playerRights 3, then change it to [Co-Owner] and add this after the switch ( after the switch's { )


if(playerName.equalsIgnoreCase("YOURNAMEHERE") {
titles = "[Owner]";
}