PDA

View Full Version : Chat error.


DerickClark
21/08/2015, 09:01 PM
........

Roberto80
21/08/2015, 09:08 PM
Dude!!!
SendClientMessage parameters:playerid,color,message.
So just add playerid before GetPlayerColor
Code:
SendClientMessage(playerid,GetPlayerColor(playerid ), string);

DerickClark
21/08/2015, 09:40 PM
Only problem i'm having is the chat is spamming.


if(Chat[playerid] == true)
{
new string[128];
format(string,sizeof(string),"(%i) %s: {FFFFFF}%s",playerid, ReturnName(playerid),text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
if(Chat[playerid] == false)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string,sizeof(string),"%s: {FFFFFF}%s",playerid, ReturnName(i),text);
SendClientMessage(playerid,GetPlayerColor(playerid ),string);
}
}
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new string[128];
format(string,sizeof(string),"%s: {FFFFFF}%s",ReturnName(i),text);
SendClientMessage(playerid,GetPlayerColor(playerid ),string);
}
}

DerickClark
21/08/2015, 10:18 PM
Anyone. this problem is spamming.

nezo2001
21/08/2015, 10:35 PM
if(Chat[playerid] == true)
{
new string[128];
format(string,sizeof(string),"(%i) %s: {FFFFFF}%s",playerid, ReturnName(playerid),text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
if(Chat[playerid] == false)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string,sizeof(string),"%s: {FFFFFF}%s",playerid, ReturnName(i),text);
}
SendClientMessage(playerid,GetPlayerColor(playerid ),string);
}
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new string[128];
format(string,sizeof(string),"%s: {FFFFFF}%s",ReturnName(i),text);
}
SendClientMessage(playerid,GetPlayerColor(playerid ),string);
}

Roberto80
22/08/2015, 08:22 AM
Use return 0;