Перейти к публикации
Поиск в
  • Дополнительно...
Искать результаты, содержащие...
Искать результаты в...
  • Нужна помощь?

    Создайте тему в соответствующем разделе
    Не нужно писать всё в чат!
  • Загляните на торговую площадку

    Там вы можете купить
    всё что касается игровых серверов
  • Не хотите бан?

    Пожалуйста, ознакомьтесь с нашими правилами
    Не нарушайте порядок!
  • Продаёте или покупаете?

    Пользуйтесь услугами гаранта
    Мы сделаем вашу сделку безопасной
  • 0
must1ka5

If Player Conected Send Message?

    void InvokeOnConnect(PlayerBase player, PlayerIdentity identity)
    {
        Debug.Log("InvokeOnConnect:"+this.ToString(),"Connect");
        if( player ) player.OnConnect();
        SendMessageToPlayer(player, "Hello Survivor, welcome to server!");
        SendMessageToPlayer(player, "To get started, you can view server rules /rules and view some useful commands /commands");
        SendMessageToPlayer(player, "Add server to your favorites list, then is easter next time join to server!");
        SendMessageToPlayer(player, "Good Luck on your journey!");
    }

Hello!

Why my message don't show when i connect to server, and how i can set timer like show this message after 2 minutes after player has connected?

Изменено пользователем must1ka5 (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Рекомендованные сообщения

  • -1

Actually i got it working be...

 

// Welcome Message START
	string welcome_msg1 = "";
	string welcome_msg2 = "";
	string welcome_msg3 = "";
	string welcome_msg4 = "";
	
	void WelcomeMessage()
	{
		welcome_msg1 = "Hello Survivor, welcome to the Extraction ExS Livonia server!";
		welcome_msg2 = "To get started, you can view server rules /rules and view some useful commands /commands or use help by /help";
		welcome_msg3 = "Add server to your favorites list, then is easter next time tp join server!";
		welcome_msg4 = "Good Luck on your journey, stay healthy, loot stuff and you will survive!")";
		ServerMessagingSystem(welcome_msg1);
		ServerMessagingSystem(welcome_msg2);
		ServerMessagingSystem(welcome_msg3);
		ServerMessagingSystem(welcome_msg4);
	}	

	void ServerMessagingSystem(string ServerMsg)
	{
		ref array<Man> players = new array<Man>;
		GetGame().GetPlayers( players );
		for ( int i = 0; i < players.Count(); ++i )
		{
			Man player = players.Get(i);
			if( player )
			{
				Param1<string> m_MessageParam = new Param1<string>(ServerMsg);
				GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity());
			}
		}
	}
// Welcome Message END
override void InvokeOnConnect(PlayerBase player, PlayerIdentity identity)
	{
		super.InvokeOnConnect(player, identity);
		super.OnInit ();
		GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(WelcomeMessage, 10000, false);  // Start after 10 seconds, when player has been connected. false = do not repeat message!
	}	

This is rip another code, no errors showing and it works!

 

@123new

What i mean by new line is

Message group

one line

second line

 

Изменено пользователем must1ka5 (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
MagicByte MagicByte MagicByte
  • 0
2 часа назад, must1ka5 сказал:

Dude i'm telling, you cannot send messages this format using motd ?

 

motd[] = {"Message Group 1 Line 1 Message Group 1 Line 2 Message Group 1 Line 3", "Message Group 2 Line 1 Message Group 2 Line 2 Message Group 2 Line 3", "Message Group 3 Line 1 Message Group 3 Line 2 Message Group 3 Line 3"}; motdInterval = 30;


motd[] = {"Message Group 1 Line 1
Message Group 1 Line 2
Message Group 1 Line 3",
"Message Group 2 Line 1
Message Group 2 Line 2
Message Group 2 Line 3",
"Message Group 3 Line 1
Message Group 3 Line 2
Message Group 3 Line 3"};
motdInterval = 30;

What i wanted is like this format!!

  Скрыть содержимое

oLvQe2c.jpg

 

don't understand you problem.

motd in config file server is worked

 

I'm telling you, it doesn't need any scripthow to write and edit this init.c any codes. This action that you are trying to do is available in the standard game functionality and is indicated in the motd parameter in the server configuration file. Messages specified in the motd array in the server configuration file (the file with the server name) are sent to the screen to each player after joining the server, and the motdInterval parameter indicates the time in seconds before sending each of the messages in the list.

If this does not suit you, please explain it in more detail, since communication via yandex translator does not inform me about this information

Изменено пользователем 123new (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • -1

For a simple this, use the default MOTD in server cfg

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • -1
17 minutes ago, 123new said:

For a simple this, use the default MOTD in server cfg

I woult, but there i cannot make new line of messages!

Like

Message1

Message2

Message3

 

?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • -1
1 минуту назад, must1ka5 сказал:

I woult, but there i cannot make new line of messages!

Like

Message1

Message2

Message3

 

?

seriously?

motd[] = {"Hello Survivor, welcome to server!",
"To get started, you can view server rules /rules and view some useful commands /commands",
"Add server to your favorites list, then is easter next time join to server!",
"Good Luck on your journey!"};
motdInterval = 30; //Message interval in seconds

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • -1
Только что, must1ka5 сказал:

Actually i got it working be...

 

// Welcome Message START string welcome_msg1 = ""; string welcome_msg2 = ""; string welcome_msg3 = ""; string welcome_msg4 = ""; void WelcomeMessage() { welcome_msg1 = "Hello Survivor, welcome to the Extraction ExS Livonia server!"; welcome_msg2 = "To get started, you can view server rules /rules and view some useful commands /commands or use help by /help"; welcome_msg3 = "Add server to your favorites list, then is easter next time tp join server!"; welcome_msg4 = "Good Luck on your journey, stay healthy, loot stuff and you will survive!")"; ServerMessagingSystem(welcome_msg1); ServerMessagingSystem(welcome_msg2); ServerMessagingSystem(welcome_msg3); ServerMessagingSystem(welcome_msg4); } void ServerMessagingSystem(string ServerMsg) { ref array<Man> players = new array<Man>; GetGame().GetPlayers( players ); for ( int i = 0; i < players.Count(); ++i ) { Man player = players.Get(i); if( player ) { Param1<string> m_MessageParam = new Param1<string>(ServerMsg); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); } } } // Welcome Message END


// Welcome Message START
	string welcome_msg1 = "";
	string welcome_msg2 = "";
	string welcome_msg3 = "";
	string welcome_msg4 = "";
	
	void WelcomeMessage()
	{
		welcome_msg1 = "Hello Survivor, welcome to the Extraction ExS Livonia server!";
		welcome_msg2 = "To get started, you can view server rules /rules and view some useful commands /commands or use help by /help";
		welcome_msg3 = "Add server to your favorites list, then is easter next time tp join server!";
		welcome_msg4 = "Good Luck on your journey, stay healthy, loot stuff and you will survive!")";
		ServerMessagingSystem(welcome_msg1);
		ServerMessagingSystem(welcome_msg2);
		ServerMessagingSystem(welcome_msg3);
		ServerMessagingSystem(welcome_msg4);
	}	

	void ServerMessagingSystem(string ServerMsg)
	{
		ref array<Man> players = new array<Man>;
		GetGame().GetPlayers( players );
		for ( int i = 0; i < players.Count(); ++i )
		{
			Man player = players.Get(i);
			if( player )
			{
				Param1<string> m_MessageParam = new Param1<string>(ServerMsg);
				GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity());
			}
		}
	}
// Welcome Message END

override void InvokeOnConnect(PlayerBase player, PlayerIdentity identity) { super.InvokeOnConnect(player, identity); super.OnInit (); GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(WelcomeMessage, 10000, false); // Start after 10 seconds, when player has been connected. false = do not repeat message! }


override void InvokeOnConnect(PlayerBase player, PlayerIdentity identity)
	{
		super.InvokeOnConnect(player, identity);
		super.OnInit ();
		GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(WelcomeMessage, 10000, false);  // Start after 10 seconds, when player has been connected. false = do not repeat message!
	}	

This is rip another code, no errors showing and it works!

incorrect

Add in your server.cfg file:

motd[] = {"Hello Survivor, welcome to server!",
"To get started, you can view server rules /rules and view some useful commands /commands",
"Add server to your favorites list, then is easter next time join to server!",
"Good Luck on your journey!"};
motdInterval = 30; //Message interval in seconds

don't need add any code in scripts files server

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • -1
1 minute ago, 123new said:

incorrect

Add in your server.cfg file:

motd[] = {"Hello Survivor, welcome to server!", "To get started, you can view server rules /rules and view some useful commands /commands", "Add server to your favorites list, then is easter next time join to server!", "Good Luck on your journey!"}; motdInterval = 30; //Message interval in seconds


motd[] = {"Hello Survivor, welcome to server!",
"To get started, you can view server rules /rules and view some useful commands /commands",
"Add server to your favorites list, then is easter next time join to server!",
"Good Luck on your journey!"};
motdInterval = 30; //Message interval in seconds

don't need add any code in scripts files server

 

What i mean by new line is

Message group

one line

second line

motd is all message one line,

motd[] = {"Message 1", - THIS IS MESSAGE 1
"Message 2", THIS MESSAGE IS 30 SEC AFTER FIRST MESSAGE
"Message 3"}; THIS MESSAGE IS 30 SEC AFTER SECOND MESSAGE
motdInterval = 30; //Message interval in seconds

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • -1
5 минут назад, must1ka5 сказал:

 

What i mean by new line is

Message group

one line

second line

motd is all message one line,

motd[] = {"Message 1", - THIS IS MESSAGE 1 "Message 2", THIS MESSAGE IS 30 SEC AFTER FIRST MESSAGE "Message 3"}; THIS MESSAGE IS 30 SEC AFTER SECOND MESSAGE motdInterval = 30; //Message interval in seconds


motd[] = {"Message 1", - THIS IS MESSAGE 1
"Message 2", THIS MESSAGE IS 30 SEC AFTER FIRST MESSAGE
"Message 3"}; THIS MESSAGE IS 30 SEC AFTER SECOND MESSAGE
motdInterval = 30; //Message interval in seconds

 

read the official page documentation:

https://forums.dayz.com/topic/239635-dayz-server-files-documentation/

in default the server cfg filename (serverDZ.cfg) used parameters is: motd, motdInterval  (check Additional Parameters)

you can add a custom messages, who is writed in chat for connecting player only after start play him

Изменено пользователем 123new (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • -1
6 minutes ago, 123new said:

read the official page documentation:

https://forums.dayz.com/topic/239635-dayz-server-files-documentation/

in default the server cfg filename (serverDZ.cfg) used parameters is: motd, motdInterval  (check Additional Parameters)

you can add a custom messages, who is writed in chat for connecting player only after start play him

Dude i'm telling, you cannot send messages this format using motd ?

 

motd[] = {"Message Group 1 Line 1
Message Group 1 Line 2
Message Group 1 Line 3",
"Message Group 2 Line 1
Message Group 2 Line 2
Message Group 2 Line 3",
"Message Group 3 Line 1
Message Group 3 Line 2
Message Group 3 Line 3"};
motdInterval = 30;

What i wanted is like this format!!

Spoiler

oLvQe2c.jpg

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы оставить комментарий

Создать аккаунт

Зарегистрируйтесь для получения аккаунта. Это просто!

Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите здесь.

Войти сейчас

×
×
  • Создать...

Важная информация

Используя этот сайт, вы автоматически обязуетесь соблюдать наши Правила и Политика конфиденциальности.
Чтобы сделать этот веб-сайт лучше, мы разместили cookies на вашем устройстве. Вы можете изменить свои настройки cookies, в противном случае мы будем считать, что вы согласны с этим.

Поддержка