SendChat: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
No edit summary
No edit summary
Tag: Manual revert
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Welcome|
{{Welcome|
desc=This function kills the npc.|
desc=This will send a chat message to the server.|
params=<syntaxhighlight lang="lua">
params=<syntaxhighlight lang="lua">(text)</syntaxhighlight>
()</syntaxhighlight>
<poem>::text : The text to send as chat message.</poem>|
<poem></poem>|
example=<source lang="lua">
example=
function OnPlayerText(player, message)
The following npc commits suicide if some one textes 'loser' to it.
<source lang="lua">
function OnPlayerText(playerid, message)
{
{
if(message=="loser")
if(message=="Hello")
{
{
Suicide()
SendChat("Hi. How are you?");
    }
}
}
}</source>|
</source>|
relfuncs=*[[SendCommand]]
relfuncs=*[[SetMyHealth]]
*[[RequestClassAbs]]|
returns=* true on success and false on failure (npc not spawned)|
}}
}}

Latest revision as of 04:06, 6 September 2024


Description:
This will send a chat message to the server.


Parameters:

(text)

text : The text to send as chat message.


Return Values:
This function does not return any specific values.


Example

function OnPlayerText(player, message)
{
	if(message=="Hello")
	{
	SendChat("Hi. How are you?");
	}
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.