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
  • 0
Sign in to follow this  
xOk

Не вижу в чате игрока сообщений с сервера

Всем привет!

Столкнулся с проблемой - не вижу в чате игрока сообщений с сервера.

Вот мой код, размещенный в 3_Game.

class Xok_Messenger {
    static 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());
        }
    }

    static void SendPersonalMessageToAllPlayers(string message) {
        array<Man> players = new array<Man>;
        GetGame().GetPlayers(players);

        foreach(Man player: players) {
            SendPersonalMessage(message, player);
        }
    }
}

Также, я создал кастомный экшн, зарегистрировал его, и при вызове этого экшена хочу отправить всем игрокам сообщение. Вот код экшена:

class ActionXok: ActionInteractBase {
	void ActionXok() {
        Xok_Quests_LoggerInstance.Debug("ActionXok() started.");

		m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
		m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
		m_HUDCursorIcon = CursorIcons.CloseHood;
        m_Text = "Задания";

        Xok_Quests_LoggerInstance.Debug("ActionXok() completed.");
	}

    override void CreateConditionComponents() {
        Xok_Quests_LoggerInstance.Debug("ActionXok.CreateConditionComponents() started.");

        m_ConditionTarget = new CCTMan(UAMaxDistances.DEFAULT);
        m_ConditionItem = new CCINone;

        Xok_Quests_LoggerInstance.Debug("ActionXok.CreateConditionComponents() completed.");
	}

	override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item ) {
        PlayerBase nTarget = PlayerBase.Cast(target.GetObject());
        if (nTarget && nTarget.IsAlive()) {
            return true;
        }

        return false;
    }

    override void OnStartClient(ActionData action_data) {
        Xok_Quests_LoggerInstance.Debug("ActionXok.OnStartClient() started.");

        Xok_Messenger.SendPersonalMessageToAllPlayers("Дратути!");

        Xok_Quests_LoggerInstance.Debug("ActionXok.OnStartClient() completed.");
    }
}

Пересобрал мод.

Для проверки работы запускаю локальный сервер и клиент следующими командами:

start /D "S:\SteamLibrary\steamapps\common\DayZ" DayZDiag_x64.exe "-mod=%mods%" "-mission=%mission%" -filePatching -server -config=serverDZ.cfg
start /D "S:\SteamLibrary\steamapps\common\DayZ" DayZDiag_x64.exe "-mod=%mods%" -filePatching -connect=127.0.0.1 -port=2302 -window

Захожу на локальный сервер, инициироую экшен, но сообщений в чате не вижу, хотя в логах сервера вижу сообщения о том, что OnStartClient успешно отработал.

 

В настройках клиента все типы сообщений в чате включены.

 

Вопрос: в чем проблема? Что я делаю не так?

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • 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.