private void systemmessage

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Sevas
Posts: 49
Joined: Sat Aug 04, 2007 5:17 am
Location: Argentina

private void systemmessage

Post by Sevas »

Hello! first of all, im so newbie with java (and english too :roll: )

I remember some time ago i write this: (in TvTEvent.java)

Code: Select all

	// CHAT YELLOW FOR ALL PLAYERS IN TVT 	/**	 * @param objectId as int<br>	 * @param name as String<br>	 * @param message as String<br>	 */	public static void chatMsgToAllPlayersinTvT(int objectId, String name, String message)	{	    CreatureSay cs = new CreatureSay(objectId, Say2.PARTYROOM_ALL, name, message);		Collection<L2PcInstance> blue = _teams[0].getParticipatedPlayers().values();		Collection<L2PcInstance> red = _teams[1].getParticipatedPlayers().values();		for (L2PcInstance playerInstance : blue) 		{			if (playerInstance != null)				playerInstance.sendPacket( cs );		}		for (L2PcInstance playerInstance : red)		{			if (playerInstance != null)				playerInstance.sendPacket( cs );		}	}	// CHAT YELLOW FOR ALL PLAYERS IN TVT
so with that i can use this: (in TvTManager.java)

Code: Select all

 [b]TvTEvent.chatMsgToAllPlayersinTvT[/b](TvTEvent.getNpcObjectId(), "TvT Event", "Teleporting to Event Area in " + Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY + " second(s).");
Now i want to do the same but with this:

Code: Select all

		{			SystemMessage sm = new SystemMessage(SystemMessageId.s3);			sm.addString("TvT Event: Registration Opened!");					Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();					for (L2PcInstance playerInstance : pls)					{						if (playerInstance != null)							playerInstance.sendPacket( sm );					}		}
hmmm...
Sevas
Posts: 49
Joined: Sat Aug 04, 2007 5:17 am
Location: Argentina

Re: private void systemmessage

Post by Sevas »

close or delete this thread :oops:

Code: Select all

 	public static void sysmsgtoall(String msg)	{ 		SystemMessage sm = new SystemMessage(SystemMessageId.s3); 		sm.addString(msg);		Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();		for (L2PcInstance playerInstance : pls)		{			if (playerInstance != null)				playerInstance.sendPacket( sm );		}

Code: Select all

sysmsgtoall("nice =D");
its working :D
Post Reply