Jump to content

Custom chat 1.0.2

   (4 reviews)

4 Screenshots

  • Like 12

User Feedback

Create an account or sign in to leave a review

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

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

Andzhu

  
Quote
$(document).ready(function()
{
    chat.container = $("#chat ul#chat_messages");
    hide();
    $(".ui_element").show();
    $("body").keydown(function(event)
    {
        if (event.which == 84 && chat.input == null
            && chat.active == true) {
            enableChatInput(true);
            event.preventDefault();
            show();
        }
        else if (event.which == 13 && chat.input != null) {
            var value = chat.input.children("input").val();
 
            if (value.length > 0) {
                chat.previous = value;
                if (value[0] == "/") {
                    value = value.substr(1);
 
                    if (value.length > 0 && value.length <= 100)
                        mp.invoke("command", value);
                }
                else {
                    if (value.length <= 100)
                        mp.invoke("chatMessage", value);
                }
            }
            enableChatInput(false);
            hide();
        }
        else if (event.which == 27 && chat.input != null) {
            enableChatInput(false);
            hide();
        }
        else if (event.which == 38 && chat.input != null) {
            chat.input.children("input").val(chat.previous);
        }
    });
      // Event handler for receiving chat messages
    mp.events.add("chat:push", (message) => {
        // Call the addChatMessage function to inject the message into the chat
        chatAPI.push(message);
    });
});

for 1.1 

good

Link to review
materia

· Edited by materia

   1 of 1 member found this review helpful 1 / 1 member

Nice resource, I am trying to implement it on my server right now and found that everything in chat/js/chat.js inside

$(document).ready(function() { ... }

is being ignored or I am doing something wrong... Found that out when I was trying to supress the mouse cursor if the player is holding "W" while starting to chat with "T" so he can continue accelerate while chatting if he decides to.

Edit: never mind.. My bad, I was missing a path for it. Great Job!

Link to review
Tellarion

   4 of 5 members found this review helpful 4 / 5 members

Very good. Thank you. Used this in my project.

Link to review
Captien

   4 of 4 members found this review helpful 4 / 4 members

beast resource...
Finally something useful for reference..

Link to review
×
×
  • Create New...