AddPlayerChatAll: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|AddPlayerChatAll(message)}} {{FuncParameters}} {{FuncParam|message|__EDIT_ME__}} {{FuncReturnValu..." |
No edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Add (or send) a chat message to everyone on the server.}} | ||
{{FuncSyntax|AddPlayerChatAll(message)}} | {{FuncSyntax|AddPlayerChatAll(message)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|message| | {{FuncParam|message|The text message to send to everyone on the server.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns '''true'''.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | |||
AddCommand("ann", function(playerid, ...) | |||
local message = table.concat({...}, " ") | |||
if #message < 10 or #message > 128 then | |||
return AddPlayerChat(playerid, "Invalid specified range of the message.") | |||
end | |||
AddPlayerChatAll(message) | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[AddPlayerChat]] | |||
* [[AddPlayerChatAll]] | |||
* [[AddPlayerChatRange]] |
Latest revision as of 18:39, 30 August 2020
Description
Add (or send) a chat message to everyone on the server.
Syntax
AddPlayerChatAll(message)
Parameters
- message
The text message to send to everyone on the server.
Return Value
- Returns true.
Example
AddCommand("ann", function(playerid, ...)
local message = table.concat({...}, " ")
if #message < 10 or #message > 128 then
return AddPlayerChat(playerid, "Invalid specified range of the message.")
end
AddPlayerChatAll(message)
end)