
Originally Posted by
MechAviv
c.getSession().write(CField.getNPCTalk(...));
Sent from my iPhone using Tapatalk
Code:
public boolean playercommandsnpc = false;
Code:
public boolean setPCN() {
return playercommandsnpc;
}
public boolean getPCN(boolean yn) {
return playercommandsnpc = yn;
}
Code:
case "npcchat":
if (player.playercommandsnpc = false)
{
// player.setPCN() = true;
player.getPCN(!player.setPCN());
player.dropMessage("Your chat style changed to NPC View is now " + (player.setPCN() ? "ON!" : "OFF!"));
}
else {
player.yellowMessage("NPC Style is On");
}
break;
Code:
case "uptime":
if (player.playercommandsnpc = false) {
long milliseconds = System.currentTimeMillis() - Server.uptime;
int seconds = (int) (milliseconds / 1000) % 60 ;
int minutes = (int) ((milliseconds / (1000*60)) % 60);
int hours = (int) ((milliseconds / (1000*60*60)) % 24);
int days = (int) ((milliseconds / (1000*60*60*24)));
player.yellowMessage("Emperial has been online for " + days + " days " + hours + " hours " + minutes + " minutes and " + seconds + " seconds.");
} else if
(player.playercommandsnpc= true){
long milliseconds = System.currentTimeMillis() - Server.uptime;
int seconds = (int) (milliseconds / 1000) % 60 ;
int minutes = (int) ((milliseconds / (1000*60)) % 60);
int hours = (int) ((milliseconds / (1000*60*60)) % 24);
int days = (int) ((milliseconds / (1000*60*60*24)));
String sendText1 = "#rHello "+ player.getName() +" this is our #e#gOnline#k system in#k #e#bMapleEmperial#k\r\n\r\n";
sendText1 += "Emperial has been online for " + days + " days " + hours + " hours " + minutes + " minutes and " + seconds + " seconds.";
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, sendText1, "00 00", (byte) 0));
}
break;
Now when i'm execute the npcchat command is shows me one time OFF and then all the time NPC Style is On and the uptime command is like all the time NPC Style
and i'm trying to make it to be saved to the database