NPC:OnClientMessage

From SA-MP Wiki

Jump to: navigation, search

NPC:OnClientMessage


Warning: This NPC callback was added in SA-MP version 0.3. It is not available in previous versions.


This callback gets called whenever the NPC sees a ClientMessage. This will be everytime a SendClientMessageToAll function is used and everytime a SendClientMessage function is sent towards the NPC. This callback won't be called when someone says something. For a version of this with player text, see NPC:OnPlayerText.


Parameters:
(color, text[])
colorThe color the ClientMessage is.
text[]The actual message.


Example:

public OnClientMessage(color, text[])
{
    if(strfind(text,"Bank Balance: $0") != -1) SendChat("I am poor :(");
}

Related Callbacks

The following callbacks might be useful as well, as they're related to this callback in one way or another.

Personal tools