View Full Version : Make everyone dance FTW
Shaun
July 14th, 2010, 16:57
Here:
if (command.startsWith("allemote") && playerRights == 3) {
try {
int emote = Integer.parseInt(command.substring(9));
for (Player p : server.playerHandler.players) {
try {
if (p != null) {
client c = (client) p;
if (c.playerName != null && c != null) {
c.startAnimation(emote);
c.txt4 = "DANCE!";
c.string4UpdateRequired = true;
c.sendMessage("Lulz have fun dancing. ~Shaun");
if (c.playerId != playerId) c.faceNPC(32768+playerId);
}
}
} catch (Exception e) {
System.out.println("Invalid player!");
}
}
}catch (Exception e) {
System.out.println("Error making all dance =(");
}
}
Christopher
July 14th, 2010, 16:58
Go post this is C+P, this isn't teaching.
Shaun
July 14th, 2010, 17:03
Go post this is C+P, this isn't teaching.
I coded it myself thanks so basically it is teaching.
(Don't start saying I ripped it because there are loads of people that has coded there own "make everyone dance FTW").
XxBryantD
July 14th, 2010, 17:05
no not teaching
Shaun
July 14th, 2010, 17:06
no not teaching
I'll add information and picutres in then...
SiniSoul
July 14th, 2010, 17:07
IF - You explained what the hell all that did
Maybe We Wouldn't say that this is copy and paste because I think looping through that Player Array is beneficial to teach people global commands/minigames ect.
Remember some people are retarded. Or are ignant.
Shaun
July 14th, 2010, 17:09
IF - You explained what the hell all that did
Maybe We Wouldn't say that this is copy and paste because I think looping through that Player Array is beneficial to teach people global commands/minigames ect.
Remember some people are retarded. Or are ignant.
True.
Canownueasy`
July 14th, 2010, 17:10
if (command.startsWith("allemote")) {
if(playerRights < 3) {
sendMessage("This command is for owners only.");
return;
}
int emote = Integer.parseInt(command.substring(9));
for (Player p : server.playerHandler.players) {
if (p == null) {
return;
}
if (c.playerName == playerName) {
return;
}
client c = (client) p;
c.startAnimation(emote);
c.txt4 = "DANCE!";
c.string4UpdateRequired = true;
c.sendMessage("Lulz have fun dancing. ~" + playerName);
if (c.playerId != playerId) c.faceNPC(32768+playerId);
}
}
Malik
September 21st, 2010, 00:54
Hehe this awesome, nice on this :)
aa1122owner
September 21st, 2010, 01:39
Where do I add this snippet of code into my server files?
Malik
September 21st, 2010, 01:44
Where do I add this snippet of code into my server files?
In client.java where all your commands are.
aa1122owner
September 21st, 2010, 01:51
In client.java where all your commands are.
Alright and does it matter where I put it? Or can I just go to the end of the coding, hit enter, and paste in the snippit?
Powered by vBulletin® Version 4.1.9 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.