GetChatMessage: Difference between revisions

m
Reverted edits by DrinkyBird (talk) to last revision by AKMDM
(3.1 is released, so Devfeature templates have been removed)
m (Reverted edits by DrinkyBird (talk) to last revision by AKMDM)
Tag: Rollback
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:ACSWarning}}
{{Template:ACSWarning}}
str '''GetChatMessage''' (int ''player'', int ''offset'')
str '''GetChatMessage''' (int ''player'', int ''offset'')
str '''GetChatMessage''' (int ''player'', int ''offset'' [, bool ''keepcolorcodes'']) {{Devfeature|3.2|alpha}}


==Usage==
==Usage==
Line 6: Line 8:


NOTE: Private chat messages (i.e. those sent using <tt>sayto</tt> or <tt>sayto_idx</tt>) are not accounted for and will not be stored into memory, nor are they retrievable.
NOTE: Private chat messages (i.e. those sent using <tt>sayto</tt> or <tt>sayto_idx</tt>) are not accounted for and will not be stored into memory, nor are they retrievable.
==Parameters==
*player: The number of the player whose chat message you want to retrieve. If you want to retrieve any messages from the server, set this to -1 instead.
*offset: Which chat message you want to retrieve. If you want the last message sent, set to to 0. If you want the oldest message still stored in memory, set this to 4.


==Return Value==
===Parameters===
Returns the chat message as a string, including color codes. If the player doesn't exist or if that player hadn't sent more messages than <tt>offset</tt>, it returns an empty string instead.
*''player'': The number of the player whose chat message you want to retrieve. If you want to retrieve any messages from the server, set this to -1 instead.
*''offset'': Which chat message you want to retrieve. If you want the last message sent, set to to 0. If you want the oldest message still stored in memory, set this to 4.
* ''keepcolorcodes'': If true, then any colour codes in the message are preserved instead of removed completely. {{Devfeature|3.2|alpha}}
 
===Return value ===
Returns the chat message as a string, with or without colour codes. If the player doesn't exist or if that player hadn't sent more messages than <tt>offset</tt>, it returns an empty string instead.
 
==Examples==
{{noexamples}}
 
==See also==
*[[EVENT scripts]] (<tt>GAMEEVENT_CHAT</tt>)


[[category:ACS Functions]]
[[category:ACS functions]]