VP_EVENT_CHAT

From Virtual Paradise Wiki
Revision as of 05:22, 25 August 2013 by Roy Curtis (talk | contribs) (Created page with "{{sdk event page|Chat|This event may be received when: * A chat message is sent to the world from a {{sdk function|say}} call * When a console message is received from a {{sdk...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Event set and handler snippet

vp_event_set(instance, VP_EVENT_CHAT, event_chat);

void event_chat(VPInstance instance) { }

This event may be received when:

  • A chat message is sent to the world from a vp_say() call
  • When a console message is received from a vp_console_message() call

Attributes

Attribute Usage
VP_CHAT_TYPE Type of chat received
VP_AVATAR_SESSION Source session ID of the chat message
VP_AVATAR_NAME Source or custom associated name of the chat message
VP_CHAT_MESSAGE Chat message itself
If VP_CHAT_TYPE == VP_CHAT_CONSOLE_MESSAGE...
VP_CHAT_EFFECTS Console message text effects bitfield
VP_CHAT_COLOR_RED Console message red color component
VP_CHAT_COLOR_GREEN Console message green color component
VP_CHAT_COLOR_BLUE Console message blue color component

Behavior

  • Clients will not receive their own chat messages
  • Clients however will receive their own console messages if they are sent to all sessions (0)
  • For console messages, VP_AVATAR_NAME may be an empty string, which is valid...
    • ...but it may also be the name of another client present. Care should be taken to identify console messages that impersonate other users.

Examples

This event has no usage examples; please add at least one to this page