This site has been archived and made available for preservation purposes. No edits can be made.

OnPlayerChat

(Difference between revisions)
Return to current revision
  1.  
    Gets called when a [wiki]Player[/wiki] sent a message.
    [h="2"] Declaration [/h]
    [highlight=cpp]
    VAULTSCRIPT VAULTSPACE State OnPlayerChat(VAULTSPACE ID, VAULTSPACE RawString) _CPP(noexcept);
    [/highlight]
    [highlight=c]
    forward OnPlayerChat(ID, message{});
    [/highlight]
    [h="2"] Parameters [/h]
  2. -
    [b][wiki="ID"]ID[/wiki][/b] - the ID of the [wiki]Container[/wiki]
  3. +
    [b][wiki="ID"]ID[/wiki][/b] - the ID of the [wiki]Player[/wiki]
  4.  
    [b][wiki="RawString"]RawString[/wiki][/b] - the entered message, which is a [wiki]MAX_CHAT_LENGTH[/wiki] sized, modifiable buffer
    [h="2"] Return value [/h]
    If returned [wiki]True[/wiki], the (updated) message will be sent to all clients. If returned [wiki]False[/wiki], the message is blocked.
    [category]VaultMP interface[/category]
    [category]Scripting callbacks[/category]