Print a message on the players screen

ozbirdboyozbirdboy Join Date: 2007-08-07 Member: 61827Confirm Email
Are there any mods available yet which allow you to print a message on the players screen?

Comments

  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    Theres a framework called cout which you could use:
    <a href="https://github.com/NS2-Modding-Collective/Cout-class" target="_blank">https://github.com/NS2-Modding-Collective/Cout-class</a>

    Or if you just want to print it in the chat from the player:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    function Player:BuildAndSendDirectMessage(message)

            //Sending Msg only to the Player  
            local playerName = self:GetName()
            local playerLocationId = -1
            local playerTeamNumber = kTeamReadyRoom
            local playerTeamType = kNeutralTeamType

            Server.SendNetworkMessage(self, "Chat", BuildChatMessage(true, playerName, playerLocationId, playerTeamNumber, playerTeamType, message), true)

        end<!--c2--></div><!--ec2-->
  • ozbirdboyozbirdboy Join Date: 2007-08-07 Member: 61827Confirm Email
    Thanks Jim.

    Regarding the framework; the level I'm making is currently using your Extra Entities Mod. Does that mean I can only use one or the other? or can I use both? If I can use both; how do I go about doing that?

    I'm thinking of going with your second option.

    What I have done is made a new lua file and placed it into the ExtraEntitesMod\lua directory. I'm then calling it using the logic_lua entity. Am I doing it right?

    I'm after a function to send a message to all players on the server; is this still the best function to use?

    Thanks
Sign In or Register to comment.