SA-MP Forums Archive
Double Chat How to fix ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Double Chat How to fix ? (/showthread.php?tid=629812)



Double Chat How to fix ? - Jihanz - 04.03.2017

Public for text
public OnPlayerText(playerid, text[])
{
new Float,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new string[128];
format(string,sizeof(string),"%s Berkata : %s",getPlayerName(playerid),text);
new chat_warna;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInRangeOfPoint(i, CHAT_RADIUS, x, y, z)) continue;
new Float:distance = GetPlayerDistanceFromPoint(i, x,y,z);
if(distance < CHAT_RADIUS / CHAT_TEXTS)
{
chat_warna = WARNA_CHAT;
}
else if(distance < CHAT_RADIUS / CHAT_TEXTS * 2)
{
chat_warna = WARNA_TEXT1;
}
else if(distance < CHAT_RADIUS / CHAT_TEXTS * 3)
{
chat_warna = WARNA_TEXT2;
}
else if(distance < CHAT_RADIUS / CHAT_TEXTS * 4)
{
chat_warna = WARNA_TEXT3;
}
else if(distance <= CHAT_RADIUS / CHAT_TEXTS * 5)
{
chat_warna = WARNA_TEXT4;
}
SendClientMessage(i, chat_warna, string);
}
return 1;
}

This My Problem



Re: Double Chat How to fix ? - RyderX - 04.03.2017

Change return 1; to return 0;


Re: Double Chat How to fix ? - Jihanz - 04.03.2017

Quote:
Originally Posted by RyderX
Посмотреть сообщение
Change return 1; to return 0;

FIXED THANKS ALOT !!



Re: Double Chat How to fix ? - Isolated - 04.03.2017

Please use [ pawn] [/ pawn] without spaces to wrap code around in future.