Jump to content
  • 0

[Help] Screen Message on TvT


Question

Posted

Hi people, i need some help here.

I want to change the systemMessage who tells you how much time last on the TvT to finish for a screenMessage.

So here is the code:

 

TvTEvent.sysMsgToAllParticipants("TvT Event: " + (time / 60) + " minute(s) until the event is finished!");

 

I must change to:

 

TvTEvent.scrMsgToAllParticipants("TvT Event: " + (time / 60) + " minute(s) until the event is finished!");

 

But if i put scr the code is worng :S

So what i have to do?

3 answers to this question

Recommended Posts

  • 0
Posted

Such method doesn't exist :). In order to make it working like that, add this method in TvTEvent, around where is the actual method sysMsgToAllParticipants( :

 

/**
 * Send a ShowScreenMessage to all participated players<br>
 * 1. Send the message to all players of team number one<br>
 * 2. Send the message to all players of team number two<br><br>
 *
 * @param message as String<br>
 */
public static void scrMsgToAllParticipants(String message, int time)
{
	for (L2PcInstance playerInstance : _teams[0].getParticipatedPlayers().values())
	{
		if (playerInstance != null)
			playerInstance.sendPacket(new ExShowScreenMessage(message, time));
	}

	for (L2PcInstance playerInstance : _teams[1].getParticipatedPlayers().values())
	{
		if (playerInstance != null)
			playerInstance.sendPacket(new ExShowScreenMessage(message, time));
	}
}:

 

Use of this method is something like : TvTEvent.scrMsgToAllParticipants((time / 60) + " minute(s) until TvT event's end !", 20000);, where 20000 = 20 seconds.

 


 

PS : you have to import ShowScreenMessage serverpacket.

  • 0
Posted

Such method doesn't exist :). In order to make it working like that, add this method in TvTEvent, around where is the actual method sysMsgToAllParticipants( :

 

/**
 * Send a ShowScreenMessage to all participated players<br>
 * 1. Send the message to all players of team number one<br>
 * 2. Send the message to all players of team number two<br><br>
 *
 * @param message as String<br>
 */
public static void scrMsgToAllParticipants(String message, int time)
{
	for (L2PcInstance playerInstance : _teams[0].getParticipatedPlayers().values())
	{
		if (playerInstance != null)
			playerInstance.sendPacket(new ExShowScreenMessage(message, time));
	}

	for (L2PcInstance playerInstance : _teams[1].getParticipatedPlayers().values())
	{
		if (playerInstance != null)
			playerInstance.sendPacket(new ExShowScreenMessage(message, time));
	}
}:

 

Use of this method is something like : TvTEvent.scrMsgToAllParticipants((time / 60) + " minute(s) until TvT event's end !", 20000);, where 20000 = 20 seconds.

 


 

PS : you have to import ShowScreenMessage serverpacket.

 

You are the best men, you have my respect.

 


 

Edit:

An image of the code working:

 

Shot00060.jpg

 

Thanx again Tryskell.

Topic Solved. Close it please :)

Guest
This topic is now closed to further replies.


×
×
  • Create New...