AddPlayerChatAll: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | <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> | </syntaxhighlight> | ||
Revision as of 15:11, 17 November 2019
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
- __EDIT_ME__
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)