1. Code:
        class Ping : CovalencePlugin
        {
            [Command("ping")]
            void PingCommand(IPlayer player, string command)
            {
                Singleton<AlertManager>.Instance.GenericTextNotificationServer($"Your ping: {player.Ping}");
            }
        }
     
  2. Wulf

    Wulf Community Admin

    Because you're using a method that sends it to all players, not a specific one.
     
  3. And what you need
     
  4. Wulf

    Wulf Community Admin

    You'd need to pass a player-specific object if the method accepts one, else use a different method.
     
  5. Code:
        class Ping : CovalencePlugin
        {
            [Command("ping")]
            void PingCommand(PlayerSession session, string command)
            {
                Singleton<AlertManager>.Instance.GenericTextNotificationServer($"Ваш пинг: {player.Ping}", session.Player);
            }
        }
    I did not understand

    I need CovalencePlugin
    rather than HurtworldPlugin
     
  6. Wulf

    Wulf Community Admin

    Open up Hurtworld's Assembly-CSharp.dll using a tool such as JustDecompiler, then search for GenericTextNotificationServer and see which parameters/arguments that method (GenericTextNotificationServer) accepts.
    [DOUBLEPOST=1499172873,1499172777][/DOUBLEPOST]
    You'd have to use Covalence methods then, not methods from Hurtworld.
    • player.Reply
    • player.Message
     
  7. Thanks

    and there is another not for HurtWorld GenericTextNotificationServer

    Help I can not find instead (ping) online
    Code:
        class Ping : HurtworldPlugin
        {
            [ChatCommand("ping")]
            void cmdsetexp(PlayerSession session, string command)
            {
                Singleton<AlertManager>.Instance.GenericTextNotificationServer($"Ping: {session.Player.Connected.Count()}", session.Player);
            }
        }
    and I need online
     
    Last edited by a moderator: Jul 4, 2017
  8. And where to download Assembly-CSharp.dll

    where the Magnifier JustDecompiler
    [DOUBLEPOST=1499175378][/DOUBLEPOST]more accurate search
     
  9. Just to confirm, are you wanting it to actually be a notification at the bottom right? Like when you loot an item? Or do you want ti to be a chat message that only the player can see?
     
  10. to be a chat message that only the player can see?
     
  11. Code:
    [ChatCommand("ping")]
    void pingCommand(PlayerSession session, string command)
    {
        hurt.SendChatMessage(session, "Your Ping is: "+session.Player.averagePing);
    }
    [ChatCommand("playercount")]
    void playercountCommand(PlayerSession session, string command)
    {
        hurt.SendChatMessage(session, "Online players: "+GameManager.Instance.GetPlayerCount());
    }
    
    Just an FYI there are plugins that do exactly what you are asking for. I would advise you use those if you are unfamiliar with C#/Unity.
    You can find a list of Plugins for Hurtworld Here: Hurtworld | Oxide