PDA

Просмотр полной версии : [Вопрос] Помогите с bigears



ExoDe
14.03.2015, 00:12
Всем привет. Такая проблема. Когда включаю bigears (видимость чата не смотря на расстояние) и если я пишу в чат пишет два раза, а если возле меня стоит ещё кто то то 4 раза итд, но команда работает норм. Помогите.
http://rghost.ru/8gwzKJfWh.view

Вот чат


public OnPlayerText(playerid, text[])
{
new idx;
new result[300],string[120];
new ip[MAX_PLAYER_NAME];
GetPlayerIp(playerid, ip, sizeof(ip));
new hour, minute, second;
result = bigstr(text, idx);
if(!strlen(result))return 0;
new playername[64];
GetPlayerName(playerid, playername, sizeof(playername));
if(strfind( result , ".tk" , true ) != -1 || strfind( result , ".com" , true ) != -1 || strfind( result , "3dn.ru" , true ) != -1 || strfind( result , ".ru" , true ) != -1 || strfind( result , ".net" , true ) != -1
|| strfind( result , ":78" , true ) != -1 || strfind( result , "*ru" , true ) != -1 || strfind( result , "172." , true ) != -1 || strfind( result , "^77" , true ) != -1
|| strfind( result , ":77" , true ) != -1 || strfind( result , ":55" , true ) != -1 || strfind( result , ":44" , true ) != -1 || strfind( result , "samp-stories" , true ) != -1
|| strfind( result , ":7777" , true ) != -1 || strfind( result , ": 7777" , true ) != -1 || strfind( result , "_ 7777" , true ) != -1 || strfind( result , ". ru" , true ) != -1
|| strfind( result , ". ru" , true ) != -1 || strfind( result , ". ru" , true ) != -1 || strfind( result , "(точка)" , true ) != -1 || strfind( result , "_ ru" , true ) != -1
|| strfind( result , "новый сервер" , true ) != -1 || strfind( result , "_77" , true ) != -1 || strfind( result , "(пробел)" , true ) != -1)
{
format(string, sizeof(string), "[Анти-реклама]:(IP:%s)%s[%d]: %s",ip,playername,playerid,result);
ABroadCast(COLOR_YELLOW,string,1);
return 0;
}
if(OOCOnline[playerid] == 0)
{
gettime(hour, minute, second);
GetPlayerName(playerid, playername, sizeof(playername));
if(Player[playerid][pMuteTime] < 1)
{
if(Masked[playerid] > 0)
{
format(string, sizeof(string), "{006400}Незнакомец говорит:{FFFFFF} %s",result);
}
else
{
format(string, sizeof(string), "{006400}%s[%d] говорит:{FFFFFF} %s",playername,playerid,result);
}
foreach(new i: Player)
{
if(Player[i][pAdmin] > 0 && BigEar[i] == 1)
{
SendClientMessage(i, COLOR_PURPLE, string);
}
}
ProxDetector(25.0, playerid,string,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
return 0;
}
else
{
format(string, sizeof(string),"[ОШИБКА] {ffffff}Ты был заткнут администрацией. Попробуй через %s.",ConvertSeconds(Player[playerid][pMuteTime]));
SendClientMessage(playerid,COLOR_RED,string);
return 0;
}
}
return 1;
}

$continue$
14.03.2015, 00:21
Опиши суть системы, что она должна делать?

ExoDe
14.03.2015, 12:36
Она должна администратору по команде показывать чат игроков, не зависимо от расстояния. Она работает, но если я пишу в чат то она показывает 2 раза

- - - Добавлено - - -

Я думаю найдётся кто мне поможет.

Wise
14.03.2015, 13:03
foreach(new i: Player)
{
if(Player[i][pAdmin] > 0 && BigEar[i] == 1)
{
SendClientMessage(i, COLOR_PURPLE, string);
}
}
Если я не ошибаюсь, то у тебя в самой функции "ProxDetector" должна стоять проверка на BigEar.
Поищи в моде "stock ProxDetector" или "public ProxDetector" (без кавычек). Если это проверка там
есть, то смело удаляй код, который находится выше. Обязательно проверь.

ExoDe
14.03.2015, 14:35
foreach(new i: Player)
{
if(Player[i][pAdmin] > 0 && BigEar[i] == 1)
{
SendClientMessage(i, COLOR_PURPLE, string);
}
}
Если я не ошибаюсь, то у тебя в самой функции "ProxDetector" должна стоять проверка на BigEar.
Поищи в моде "stock ProxDetector" или "public ProxDetector" (без кавычек). Если это проверка там
есть, то смело удаляй код, который находится выше. Обязательно проверь.

Нету проверки.

ExoDe
15.03.2015, 18:01
Ну что, кто поможет?

ExoDe
19.03.2015, 14:42
Народ, не ужели нету таких кто мне поможет?

L0ndl3m
20.03.2015, 00:43
ProxDetector выложите.

ExoDe
20.03.2015, 23:49
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
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++)
foreach(new i: Player)
{
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)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}//not connected
return 1;
}

это?

Vinc
22.03.2015, 08:22
Вот этот код в onplayertext у себя удали:


foreach(new i: Player)
{
if(Player[i][pAdmin] > 0 && BigEar[i] == 1)
{
SendClientMessage(i, COLOR_PURPLE, string);
}
}

И в ProxDetector добавь проверку на активацию у админа возможности видить весь чат внезависимости от расстояния.

т.е. замени свой ProxDetector на вот этот:


public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
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++)
foreach(new i: Player)
{
if(IsPlayerConnected(i))
{
if(Player[i][pAdmin] < 1 || !BigEar[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)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
else
{
SendClientMessage(i, COLOR_PURPLE, string);
}
}
}
}//not connected
return 1;
}

ExoDe
23.03.2015, 17:30
Спасибо большое.