AddPlayerChatAll: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
{{FuncParam|message|The text message to send to everyone on the server.}}
{{FuncParam|message|The text message to send to everyone on the server.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns '''true'''.}}


== Example ==
== Example ==
<syntaxhighlight lang="Lua>
<syntaxhighlight lang="Lua>
-- code
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>



Latest revision as of 18:39, 30 August 2020

AddPlayerChatAll

Type: Function
Context: Server
Introduced: v1.0

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)

See also