SA-MP Forums Archive
Double Chat Messages - 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 Messages (/showthread.php?tid=566082)



Double Chat Messages - satafinix - 03.03.2015

Hi, i got this probllem on my samp server while playing just sometimes i got this



Any solution?


Re : Double Chat Messages - Golimad - 03.03.2015

Show us what's below OnPlayerText.


Re : Double Chat Messages - satafinix - 03.03.2015

there is alot of stuff below OnPlayerText so this the player chat Code

Quote:

if(ServerVariables[CHAT_WITH_ID])
{
new color = GetPlayerColor(playerid);
format(string,sizeof(string),"» %s {D0E0FF}[%d]{FF0000}: {FFFFFF}%s", PlayerName[playerid], playerid, text);
ForEachPlayer(i)
if(!BlockedPlayerList[i][playerid])
SendClientMessage(i, color, string);
}
else
ForEachPlayer(i)
if(!BlockedPlayerList[i][playerid])
SendPlayerMessageToPlayer(i,playerid,text);
return 0;




Re : Double Chat Messages - Golimad - 03.03.2015

I think that sends the text twice.
Код:
 
if(ServerVariables[CHAT_WITH_ID])
{
new color = GetPlayerColor(playerid);
format(string,sizeof(string),"» %s {D0E0FF}[%d]{FF0000}: {FFFFFF}%s", PlayerName[playerid], playerid, text);
ForEachPlayer(i)
if(!BlockedPlayerList[i][playerid])
SendClientMessage(i, color, string);
return 0;
}
else
ForEachPlayer(i)
if(!BlockedPlayerList[i][playerid])
SendPlayerMessageToPlayer(i,playerid,text);
return 0;
Mind trying this one ?


Re: Double Chat Messages - X337 - 03.03.2015

Код:
if(ServerVariables[CHAT_WITH_ID])
{
new color = GetPlayerColor(playerid);
format(string,sizeof(string),"» %s {D0E0FF}[%d]{FF0000}: {FFFFFF}%s", PlayerName[playerid], playerid, text);
foreach (new i : Player)
{
if(!BlockedPlayerList[i][playerid])
SendClientMessage(i, color, string);
}
}
else
{
foreach (new i : Player)
{
if(!BlockedPlayerList[i][playerid])
SendPlayerMessageToPlayer(i,playerid,text);
}
}
return 0;
Hope it work


Re : Double Chat Messages - satafinix - 03.03.2015

Im Gonna try them both

thanks =)