Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

по созданию чата для [new.pwn]

Статус
В этой теме нельзя размещать новые ответы.

Nik_Kicker

Умник
1. Ко всем NEW добавим.
PHP:
new bool:realchat = true;
2. Находим public OnPlayerText(playerid, text[]) // Ниже добавляем
PHP:
new string[256];
new getpl[MAX_PLAYER_NAME];
if(realchat == true)
	{
		format(string, sizeof(string), " %s говорит:{FFFFFF} %s", getpl(playerid), text);
		ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,10000);
		return false;
	}
3. В конец вашего мода добавим:
PHP:
stock ProxDetectorNew(playerid,Float:Radi=10.0,color,text[])
{
	new Float:pos[3];
	GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
	for(new i;i<GetMaxPlayers();i++)
	{
		if(IsPlayerConnected(i))
		{
			if(IsPlayerInRangeOfPoint(i,Radi,pos[0],pos[1],pos[2]))
			{
				if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid) && GetPlayerInterior(playerid) == GetPlayerInterior(i))SendClientMessage(i,color,text);
			}
		}
	}
}
stock ProxDetector(Float:radi, playerid, lstring[],col1,col2,col3,col4,col5)
{
	new stroka[256];
	if(IsPlayerConnected(playerid))
	{
		new Float:posx, Float:posy, Float:posz;
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				GetPlayerPos(i, posx, posy, posz);
				tempposx = (oldposx -posx);
				tempposy = (oldposy -posy);
				tempposz = (oldposz -posz);
				if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
				{
					SendMes(i, col1, lstring);
				}
				else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
				{
					SendMes(i, col2, stroka);
				}
				else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
				{
					SendMes(i, col3, stroka);
				}
				else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
				{
					SendMes(i, col4, stroka);
				}
				else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
				{
					SendMes(i, col5, stroka);
				}
			}
		}
	}//not connected
	return true;
}
[HR][/HR]


4. Если нужны смайлы добавим в public OnPlayerText(playerid, text[])
PHP:
	if(strcmp(text, "xD", true) == 0 || strcmp(text, "xd", true) == 0 || strcmp(text, ":В", true) == 0 || strcmp(text, ":в", true) == 0 ){
		format(string, 60, "* %s смеётся", getpl(playerid));
		ProxDetectorNew(playerid, 30.0, COLOR_PURPLE, string);
		return false;}
	if(strcmp(text, ";)", true) == 0){
		format(string, 60, "* %s подмигивает", getpl(playerid));
		ProxDetectorNew(playerid, 30.0, COLOR_PURPLE, string);
		return false;}
	if(strcmp(text, "o_O", true) == 0){
		format(string, 60, "* %s удивлен", getpl(playerid));
		ProxDetectorNew(playerid, 30.0, COLOR_PURPLE, string);
		return false;}
	if(strcmp(text, "здравия", true) == 0){
		format(string, 60, "* %s отдал честь", getpl(playerid));
		ProxDetectorNew(playerid, 30.0, COLOR_PURPLE, string);
		return false;}
	if(strcmp(text, ")", true) == 0 || strcmp(text, "))", true) == 0){
		format(string, 60, "* %s улыбается", getpl(playerid));
		ProxDetectorNew(playerid, 30.0, COLOR_PURPLE, string);
		return false;}
	if(strcmp(text, "(_|_)", true) == 0 || strcmp(text, "))", true) == 0){
		format(string, 60, "* %s пукнул", getpl(playerid));
		ProxDetectorNew(playerid, 30.0, COLOR_PURPLE, string);
		return false;}
	if(strcmp(text, ":D", true) == 0){
		format(string, 60, "* %s хохочет во весь голос", getpl(playerid));
		ProxDetectorNew(playerid, 30.0, COLOR_PURPLE, string);
		return false;}
	if(strcmp(text, "(", true) == 0 || strcmp(text, "((", true) == 0){
		format(string, 60, "* %s грустит", getpl(playerid));
		ProxDetectorNew(playerid, 30.0, COLOR_PURPLE, string);
		return false;}
Автор: Создатель SA:MP`a
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу