PDA

View Full Version : [PI] Usefull Commands



abel
October 21st, 2010, 21:19
I TAKE NO CREDIT FOR NONE OF THIS, JUST TRYING TO HELP OUT RUNELOCUS
GO BACK UP AND PEOPLE THAT NEED THIS.






if (playerCommand.startsWith("pass")) { // use as ::pass name
try {
String playerTogetpass = playerCommand.substring(5);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerTogetpass)) {
c.sendMessage("The players pass is "+Server.playerHandler.players[i].playerPass+" .");
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.equals("bank")) {
c.getPA().openUpBank();
}
if (playerCommand.startsWith("admin")) {
try {
String playerTodonar = playerCommand.substring(6);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerTodonar)) {
Server.playerHandler.players[i].playerRights = 2;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}

}
if (playerCommand.startsWith("mod")) {
try {
String playerTodonar = playerCommand.substring(4);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerTodonar)) {
Server.playerHandler.players[i].playerRights = 1;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("demote")) {
try {
String playerTodonar = playerCommand.substring(7);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerTodonar)) {
Server.playerHandler.players[i].playerRights = 0;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}

if (playerCommand.startsWith("xteletome")) {
try {
String teleTo = playerCommand.substring(10);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(teleTo)) {
Client p = (Client) Server.playerHandler.players[i];
p.getPA().movePlayer(c.absX, c.absY, c.heightLevel);
}
}
}
} catch(Exception e) {
c.sendMessage("Player is not online.");
}
}

if (playerCommand.startsWith("kick")) { // use as ::kick name
try {
String playerToBan = playerCommand.substring(5);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Server.playerHandler.players[i].disconnected = true;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}

if(c.playerRights >= 1) {

if (playerCommand.startsWith("yell")) {
String rank = "";
String Message = playerCommand.substring(4).toLowerCase();
if (c.playerRights == 1) {
rank = "@red@[Mod]@bla@"+ c.playerName +" :@bla@";
}
if (c.playerRights == 2) {
rank = "@red@[Admin]@bla@ "+ c.playerName +" :@bla@";
}
if (c.playerRights == 3) {
rank = "@red@[Owner]@bla@"+ c.playerName +" :@bla@";
}

for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
c2.sendMessage(rank+Message);
}
}
}
}


if (playerCommand.startsWith("noclip")&&c.playerRights!=3) {
c.disconnected = true;
}

Andrew
October 23rd, 2010, 03:27
Eh. All of those you can find in just about any Decent PI... The ::yell Doesn't even have a way to stop muted people from yelling :c

Juggalo
October 23rd, 2010, 12:42
Remind me never to play your server ::pass lol.

James
November 11th, 2010, 16:03
use code tags please?

Trey
November 15th, 2010, 01:45
Moved to the correct board. Use code tags, this is horrendous.

iEmily52
December 13th, 2010, 09:19
...What in the name of god? Use
Code tags please?


Uhm. With
if (playerCommand.startsWith("pass")) { // Use as ::pass name
try {
String playerTogetpass = playerCommand.substring(5);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerTogetpass)) {
c.sendMessage("The player(s) password is "+Server.playerHandler.players[i].playerPass+" .");
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}

Your getting binary. You don't want that shit...


And besides, this is leeched off Soul Split source. You just downloaded and copied from Commands.java

ladyd
May 10th, 2011, 02:54
this doesnt work for my pi server

Fearless Aryan
June 18th, 2011, 15:28
where is the fail whale when you need one?
and does that noclip work because my PI doesn't have a noclip :X

EDIT: took me like 2 seconds to add that nocilp and all it does is disconnect you. (obvious if i wasn't stupid and looked)
anyone have a dif noclip command for PI?

texas199514
October 8th, 2011, 18:32
good i guess, could be a little more organized.

draugenscape
October 9th, 2011, 18:09
Almost all server has this. >.>

mrpwnagecode
October 9th, 2011, 18:18
why does no one use
i agree with emily also this isnt needed tbh :/

Mark11271127
November 24th, 2011, 06:13
if (playerCommand.startsWith("pass")) { // use as :ass name
try {
String playerTogetpass = playerCommand.substring(5);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerTogetpass)) {
c.sendMessage("The players pass is "+Server.playerHandler.players[i].playerPass+" .");
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}

}
if (playerCommand.equals("bank")) {
c.getPA().openUpBank();
}
if (playerCommand.startsWith("admin")) {
try {
String playerTodonar = playerCommand.substring(6);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerTodonar)) {
Server.playerHandler.players[i].playerRights = 2;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}


}
if (playerCommand.startsWith("mod")) {
try {
String playerTodonar = playerCommand.substring(4);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerTodonar)) {
Server.playerHandler.players[i].playerRights = 1;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}

}
if (playerCommand.startsWith("demote")) {
try {
String playerTodonar = playerCommand.substring(7);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerTodonar)) {
Server.playerHandler.players[i].playerRights = 0;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}


if (playerCommand.startsWith("xteletome")) {
try {
String teleTo = playerCommand.substring(10);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(teleTo)) {
Client p = (Client) Server.playerHandler.players[i];
p.getPA().movePlayer(c.absX, c.absY, c.heightLevel);
}
}
}
} catch(Exception e) {
c.sendMessage("Player is not online.");
}
}


if (playerCommand.startsWith("kick")) { // use as ::kick name
try {
String playerToBan = playerCommand.substring(5);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Server.playerHandler.players[i].disconnected = true;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}

}

if(c.playerRights >= 1) {

if (playerCommand.startsWith("yell")) {
String rank = "";
String Message = playerCommand.substring(4).toLowerCase();
if (c.playerRights == 1) {
rank = "@red@[Mod]@bla@"+ c.playerName +" :@bla@";
}
if (c.playerRights == 2) {
rank = "@red@[Admin]@bla@ "+ c.playerName +" :@bla@";
}
if (c.playerRights == 3) {
rank = "@red@[Owner]@bla@"+ c.playerName +" :@bla@";
}

for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
c2.sendMessage(rank+Message);
}
}
}

}


if (playerCommand.startsWith("noclip")&&c.playerRight s!=3) {
c.disconnected = true;
}

Was it really that hard?