OnPlayerText Problem , need help
#1

So i got those OnPlayerText

Код:
public OnPlayerText(playerid,text[])
{
	new string[128]; GetPlayerName(playerid,string,sizeof(string));
	format(string,sizeof(string),"%s {0000FF}: %s",CheckTAG(playerid),text); SendClientMessageToAll(GetPlayerColor(playerid),string);
	return 1;
}
and this is the CheckTag
Quote:

CheckTAG(playerid)
{
new Nick[MAX_PLAYER_NAME + 1],string[55];
GetPlayerName(playerid,Nick,sizeof(Nick));
if(!strcmp(Nick,"[GC]",true,4))
{
string = "{00FF00}[{FF0000}GC{00FF00}]";
strcat(string, Nick[4]);
return string;
}
strcat(string,Nick);
return string;
}
*problems*
#Message sends Twice (Duplicate)
Color of tag
Orange color
______________________________
without tag
player name its black
so
can anyone figure out how can i fix the double message send
and removing black color
Reply
#2

pawn Код:
public OnPlayerText(playerid,text[])
{
    new string[128]; GetPlayerName(playerid,string,sizeof(string));
    format(string,sizeof(string),"%s {0000FF}: %s",CheckTAG(playerid),text); SendClientMessageToAll(GetPlayerColor(playerid),string);
    return 0;
}
Reply
#3

Quote:
Originally Posted by PainNagato
Посмотреть сообщение
pawn Код:
public OnPlayerText(playerid,text[])
{
    new string[128]; GetPlayerName(playerid,string,sizeof(string));
    format(string,sizeof(string),"%s {0000FF}: %s",CheckTAG(playerid),text); SendClientMessageToAll(GetPlayerColor(playerid),string);
    return 0;
}
yeah return 0;
it will even send the message ?
Reply
#4

it will stop double message.

because you want to send custom message
using SendClientMessageToAll(GetPlayerColor(playerid),st ring);

so You need OnPlayerText return 0; to stop double message.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)