[Include] [INC] Easy Local Chat!
#1

Easy Local Chat
By Goudewup

What is it?
Easy Local Chat is a include that makes it easy to make a local chat like in most RP servers.
Feel free to use it, but don't remove the credits!
It ads the following functions:
GetDistanceBetweenPlayers(playerid, playerid2)
SendLocalMessage(playerid, color, radius ,string[]);

Examples:
Code:
public OnPlayerText(playerid,text[])
{
	new name[MAX_PLAYER_NAME], string[128];
	GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "%s: %s", name, text);
	SendLocalMessage(playerid, COLOR_WHITE, 7,string);// Send the message
	return 0; // Makes sure the original message isn't send
}
This code will make all chat messages send local.

Code:
	if(strcmp(cmdtext, "/me", true, 3) == 0)
    {
    if(!cmdtext[3])return SendClientMessage(playerid, COLOR_RED, "USAGE: /me [text]");
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "*%s %s", str, cmdtext[4]);
    SendLocalMessage(playerid, COLOR_PURPLE, 7, str);
    return 1;
    }
This is a working /me command.

Installation:
All you have to do is put this under #include <a_samp>:
Code:
#include <LocalChat>
Changelog
Quote:
Version 2
Added a paramater to declare the radius of the chat.

Download:
V2
Pastebin (save as LocalChat.inc)
Updo (Hotlink)


V1
Pastebin (save as LocalChat.inc)
Updo (Hotlink)
2Shared
Reply


Messages In This Thread
[INC] Easy Local Chat! - by goudewup - 30.01.2010, 14:16
Re: [INC] Easy Local Chat! - by goudewup - 30.01.2010, 14:58
Re: [INC] Easy Local Chat! - by NiiRV4N4 - 25.03.2010, 19:56
Re: [INC] Easy Local Chat! - by ChrisMorasco - 11.06.2013, 18:31
AW: [INC] Easy Local Chat! - by BigETI - 11.06.2013, 20:11

Forum Jump:


Users browsing this thread: 1 Guest(s)