NPC:SendChat

From SA-MP Wiki

Jump to: navigation, search

NPC:SendChat


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


This will send a player text by the bot, just like using SendPlayerMessageToAll, but this function is to be used inside the NPC scripts.


Parameters:
(msg[])
msg[]The text to be sent by the NPC.


This function does not return a specific value.


public OnPlayerDeath(playerid)
{
    new string[80], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
 
    format(string, sizeof(string), "Oh no %s! I didn't want you to die that way!", name);
    SendChat(string);
    return 1;
}

Related Functions

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

Personal tools