OnPlayerChat: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
Chloe (talk | contribs)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:


{{FuncSyntax|OnPlayerChat(player, text)}}
{{FuncSyntax|OnPlayerChat(player, text)}}
{{FuncSyntaxClient|OnPlayerChat(text)}}


{{FuncParameters}}
{{FuncParameters}}
Line 20: Line 21:


{{RelatedFunctions}}
{{RelatedFunctions}}
{{ServerEvents}}
{{PlayerEvents}}

Latest revision as of 08:05, 16 January 2020

OnPlayerChat

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

Description

The event that gets called when you type a message in the chat.

Syntax

OnPlayerChat(player, text)
Client Syntax
OnPlayerChat(text)

Parameters

  • player
    The player who is texting in chat.
  • text
    Text committed by the player.

Example

AddEvent("OnPlayerChat", function(playerid, text)
	local x, y, z = GetPlayerLocation(playerid)

	AddPlayerChatRange(x, y, 75.0, "<span color=\"#ffffffFF\">"..GetPlayerName(playerid).." says: "..text.."</>")
	return false
end)

See also