You want it to announce it to the server when you log in? is that what your trying to say?
Or when anybody logs in?
|
Hello I need Help when yell says eg"nuno has logged in for the first time,welcome"
How to add that in pi?
You want it to announce it to the server when you log in? is that what your trying to say?
Or when anybody logs in?
no When a new Player Logs in
addStarter method
put something like
for (Player p : PlayerHandler.players) {
if (p != null) {
Client players = (Client) p;
p.sendMessage(c.playerName + " has logged in for the first time, welcome.");
}
}
src\server\model\players\PlayerAssistant.java:2634 : cannot find symbol
symbol : method sendMessage(java.lang.String)
location: class server.model.players.Player
p.sendMessage(c.playerName + " has logged in for the first time, welcome.");
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Press any key to continue . . .
You got this part? for (Player p : PlayerHandler.players)
i gave him fix in msn. i just mde a mistake its players.sendMessage not p.sendMessage
erm I did this without testing you might wana fix it if you get any errors
playersave.javaCode:isNew,
Code:} else if (token.equals("isNew")) { p.isNew = Integer.parseInt(token2);
Client.javaCode:characterfile.write("isNew = ", 0, 8); characterfile.write(Integer.toString(p.pkPoints), 0, Integer.toString(p.pkPoints).length()); characterfile.newLine(); characterfile.newLine();
under
Code:public void initialize() {
not sure if you'll get errors should work though..Code: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.isNew == 0) { c2.sendMessage(""+ Misc.optimizeText(playerName) +" has logged in for the first time!"); c.isNew += 1; } else if (c.isNew == 1) { return; } } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |