PDA

View Full Version : Double Chat Messages


satafinix
03/03/2015, 12:49 PM
Hi, i got this probllem on my samp server while playing just sometimes i got this

http://i.imgur.com/XW7V38i.jpg

Any solution?

Golimad
03/03/2015, 12:52 PM
Show us what's below OnPlayerText.

satafinix
03/03/2015, 12:55 PM
there is alot of stuff below OnPlayerText so this the player chat Code

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;

Golimad
03/03/2015, 01:14 PM
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 ?

X337
03/03/2015, 01:18 PM
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

satafinix
03/03/2015, 01:21 PM
Im Gonna try them both

thanks =)