Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe

Search the Community

Showing results for tags 'оповещение'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Main category
    • S-Platoon
    • Private section
    • Marketplace
    • Chatter
  • DayZ Standalone
    • Instructions
    • Help
    • Other
    • English section
  • General section
    • ARMA 3
    • DayZ mod
    • ARMA 2
    • CS: Global offensive
    • ARK: Survival Evolved
    • Minecraft
    • Rust
  • Product support topics

Categories

  • DayZ
    • Ready servers
    • Scripts, mods, files etc.
    • Vehicles
    • Weapons, tools, items
    • Map add-ons
    • Models
    • Software
    • Other
  • Arma 3
    • Ready servers
    • Scripts, mods, files etc.
    • Vehicles
    • Models
    • Software
    • Other

Product Groups

  • Privileges on the forum
  • Advertising on the site

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


VK Social


Steam


ICQ


Skype


City


Web-site


Interests

Found 2 results

  1. В данной теме мы с вами научимся создавать простой скрипт, который позволит выводить в чат объявления о присоединении и отсоединении игроков, а также логировать их данные. Нам понадобится: 1. Сервер DayZ 1.0, сделанный по одному из гайдов: 2. Notepad++ 3. Немножечко трезвого ума Приступим: 1. Открываем Mpmissions - dayzOffline.chernarusplus - init.c 2. В самом начале файла добавляем: #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\ConnectDisconnectMessagesInChat.c" Обратите внимание, имя папки с активной mpmissions сервера у вас может отличаться от стандартного названия dayzOffline.chernarusplus - в таком случае в ссылке выше имя этой папки также надо заменить (это актуально в основном для серверов аренды) 3. Помещаем в папку файлConnectDisconnectMessagesInChat.cЛибо создаем вручную этот файл с именем " "ConnectDisconnectMessagesInChat.c" и заполняем его следующим текстом: modded class CustomMission { void SendGlobalChatMessage(string message) { private array<Man> players = new array<Man>; GetGame().GetPlayers( players ); int numbOfplayers = players.Count(); if( numbOfplayers > 0 ) { foreach(Man player: players) { SendPersonalMessage(message, player); } //GetGame().ChatPlayer(message); } } void SendPersonalMessage(string message, Man player) { if(( player ) && (message != "")) { Param1<string> m_GlobalMessage = new Param1<string>(message); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_GlobalMessage, true, player.GetIdentity()); } } override void InvokeOnDisconnect( PlayerBase player ) { private PlayerIdentity identity = NULL; identity = player.GetIdentity(); if (player && identity) { private string Name_P = identity.GetName(); private string UID_P = identity.GetPlainId(); private string message = "[Информация] Игрок " + Name_P + " отключился от сервера."; private string log_message = "[Disconnect] Player " + Name_P + " with Steam64ID: " + UID_P + " disconnected from server."; //GetGame().ChatPlayer(message); SendGlobalChatMessage(message); Print(log_message); } super.InvokeOnDisconnect( player ); } override void InvokeOnConnect(PlayerBase player, PlayerIdentity identity) { super.InvokeOnConnect(player, identity); private string Name_P = identity.GetName(); private string UID_P = identity.GetPlainId(); private string message = "[Информация] Игрок " + Name_P + " Зашёл на сервер."; private string log_message = "[Connect] Player " + Name_P + " with Steam64ID: " + UID_P + "connected to server."; //GetGame().ChatPlayer(message); SendGlobalChatMessage(message); Print(log_message); } } 4. Настраиваем текст как нам нужно. Т.е. в строках для чата private string message = "[Информация] Игрок " + Name_P + " отключился от сервера."; и private string message = "[Информация] Игрок " + Name_P + " Зашёл на сервер."; а также для логов private string log_message = "[Disconnect] Player " + Name_P + " with Steam64ID: " + UID_P + " disconnected from server."; и private string log_message = "[Connect] Player " + Name_P + " with Steam64ID: " + UID_P + "connected to server."; P.S. Если сообщения вам не видны, включите их видимость в настройках вашего клиента игры для себя!
  2. Автор скрипта сообщения всем пользователям: Мизев Код функции отправки сообщения всем игрокам вставляется в OnInit () в init.c или в missionserver.c из scripts.pbo Становится глобальной серверной функцией и можно использовать где угодно на сервере (вроде бы) Что делает? Отправляет сообщение переданное в функцию всем игрокам на сервере Использование: MessageAllPlayers ("ТЕКСТ"); void MessageAllPlayers(string message) { ref array<Man> players = new array<Man>; GetGame().GetPlayers( players ); if ( players.Count() > 0 ) { for ( int i = 0; i < players.Count(); i++ ) { PlayerBase player; Class.CastTo(player, players.Get(i)); Param1<string> m_MessageParam = new Param1<string>(message); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); } } } Код сообщения всем игрокам на сервере о входе НОВОГО игрока вставляется в код создания персонажа, обработки его подключения или экипировки при входе - где Вам больше нравится но после того как персонаж создастся и будет помещен в переменную к которой можно обратиться В данном примере m_player исполняется в контексте конкретного персонажа Например init.c override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName) { //...... //тут еще разный код playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player Class.CastTo(m_player, playerEnt); GetGame().SelectPlayer(identity, m_player); //inform all players about new player connected ref array<Man> players = new array<Man>; //define array for all players GetGame().GetPlayers( players ); //put all players in to array players if ( players.Count() > 0 ) // if players count > 0 { string Message = "NEW Player " + m_player.GetIdentity().GetName() + " connected!"; //message text MessageAllPlayers(Message); // call MessageAllPlayers function with Message param } return m_player; }
×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Поддержка