Page 1 of 1

private void systemmessage

Posted: Wed Jan 06, 2010 9:20 pm
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 );					}		}

Re: private void systemmessage

Posted: Wed Jan 06, 2010 10:43 pm
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