SA-MP Forums Archive
OnPlayerText Problem , need help - 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: OnPlayerText Problem , need help (/showthread.php?tid=607567)



OnPlayerText Problem , need help - CraTzy - 21.05.2016

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


Re: OnPlayerText Problem , need help - PainNagato - 21.05.2016

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;
}



Re: OnPlayerText Problem , need help - CraTzy - 21.05.2016

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 ?


Re: OnPlayerText Problem , need help - MBilal - 21.05.2016

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.