AddPlayerChat

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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 (Server)

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

Example (Client)

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

See also