Jump to content

Problem with the /me Command


Senze

Recommended Posts

Hey Guys there is a command i think its integrated in MTASA

the command is known as "/me arg1 agr2 arg3 ..." and its in use to talk with other players but the problem there are chatlimits to my script but the command will talk to alle an ignored the chatlimits

i have no ideas to "turn off" thne command the one i think is to canel it in "onPlayerChat" but how?

Someone can Help me Plz :)

Nice Greeze

SenZe

Link to comment

According to wiki onPlayerChat event has two parameters.

Parameters
string message, int messageType

  • message: A string representing the message typed into the chat.
  • messageType: An integer value representing the message type:
    [-] 0: normal message
    [-] 1: action message (/me)
    [-] 2: team message

And when cancelling the event

If this event is canceled, the game's chat system won't deliver the posts. You may use outputChatBox to send the messages then. Cancelling this event also means the chat will not appear in the server console or logs. If you want chat logging, you will have to add a call to outputServerLog - See the second example.

So all you have to do is attach a function to "onPlayerChat" event and check, if the messageType is 1, cancel the event. I'm not going to show you the exact code, as it's better for you if you manage to script it yourself.

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...