AddPlayerChat: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|Adds (or sends) the specified player or client a message.}}
{{FuncDescription|Adds (or sends) the specified player or client a message.
 
The chat is not HTML but it supports the <span> tag to change color, font size and style.}}


{{FuncSyntax|AddPlayerChat(player, message)}}
{{FuncSyntax|AddPlayerChat(player, message)}}
Line 15: Line 17:
<syntaxhighlight lang="Lua>
<syntaxhighlight lang="Lua>
AddCommand("commands", function(playerid)
AddCommand("commands", function(playerid)
AddPlayerChat(playerid, "You just executed a command!")
local message = "You just executed a command!"
        AddPlayerChat(playerid, '<span color="#ff0000bb" style="bold" size="10">'..message..'</>')
return
return
end)
end)

Revision as of 14:11, 26 April 2020

AddPlayerChat

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Adds (or sends) the specified player or client a message.

The chat is not HTML but it supports the tag to change color, font size and style.

Syntax

AddPlayerChat(player, message)
Client Syntax
AddPlayerChat(message)

Parameters

  • player
    The player indentifier.
  • message
    The chat message.

Return Value

  • Returns true.

Example

AddCommand("commands", function(playerid)
	local message = "You just executed a command!"
        AddPlayerChat(playerid, '<span color="#ff0000bb" style="bold" size="10">'..message..'</>')
	return
end)

See also