By default, the chat provides a few commands:
- /slowchat (on|off) - Will enable or disable slowchat for the current session.
- /ban (Username) (Time) (Reason) - Bans a player. Time is in days.
- /gms-kick (Username) - Kicks a player
- /mute (Username) - Mutes a player for 5 minutes
You can add more commands by using gms_script_set_chat_verify
, like this:
In the script you receive the text the user just entered as argument0. You can use this text to pre-process the chat message before sending it. Finally the script should return true if the message should still be sent, or false if the message should be discarded.
For example, to check if a chat message starts with "/command", use this code:
if string_copy(argument0, 1, 8) == "/command"