Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MP.SendChatMessage() should be able to specify username #384

Open
worldofrice opened this issue Nov 1, 2024 · 3 comments
Open

MP.SendChatMessage() should be able to specify username #384

worldofrice opened this issue Nov 1, 2024 · 3 comments
Labels
feature New feature or request

Comments

@worldofrice
Copy link

Is your feature request related to a problem? Please describe.
I'm currently creating a proximity text chat mod for BeamMP and I find it very frustrating that when calling MP.SendChatMessage() it shows up on the client with the prefix of Server:.

Describe the solution you'd like
I think the MP.SendChatMessage() should have another parameter for username.

Describe alternatives you've considered
An alternative I found, was just to have an event on the client-side, that gets called by the server whenever there is a new message. It is using the UI.chatMessage() provided by UI.lua. This way I can set a custom name for everyone.

@worldofrice worldofrice added the feature New feature or request label Nov 1, 2024
@StanleyDudek
Copy link

MP.SendChatMessage(player_id, message, prefix)

Where prefix is the username presented in chat, not including the colon.

MP.SendChatMessage(1, "Hello", "aName")

Player ID 1 receives:

aName: Hello

in chat

@worldofrice
Copy link
Author

bump

@WiserTixx
Copy link
Collaborator

Currently, it is this way because the client doesn't accept any custom formatting if the sender isn't "Server".
I propose a MP.SendChatMessageRaw(player_id, message) function which will put what you put it directly into chat with formatting and without the server prefix. This would require slight changes on the mod as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants