Sends a chat message with a custom tag. The text and color arguments are equivalent to the gms_chat script.
The tag argument can be a string of no more than 96 characters. You can use this to store additional information about the chat message.
Chat messages accompanied by a tag do not show up in the default chat box. You must register a custom script with gms_script_set_chat_receive to handle these chat messages.
Voorbeeld
// Set the receive script after gms_settings
gms_script_set_chat_receive(on_chat_receive)
// Prepare the tag data
var data = ds_map_create(); data[? "s"] = spr_bobby // custom sprite for the message
data[? "i"] = image_index // custom index
data[? "r"] = room
// Send the chat message with the tag encoded as JSON
var sender_id = argument0, text = argument1, color = argument2, tag = argument3; // Only process custom messages that don't show up in the default chat
if tag != "" { // Decode the tag data
var data = json_decode(tag);
// Only show the custom message if we're in the same room
if room == data[? "r"] { // TODO: Show custom chat message with text, color, data[? "s"], data[? "i"]