OnPlayerText & Colour Problems - 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 & Colour Problems (
/showthread.php?tid=585425)
OnPlayerText & Colour Problems -
Toxik - 13.08.2015
small problem
Now colors are White when player type something
i would like to get player color and to show it in chat
example in TAB Bar Someone has color blue
and in the show blue name in chat and the Text White
and if player have in name [GC] Tag
his tag color chages to Red and yellow
FIXED THE CHAT COLOURS
but can anyone tell me how can i make Clan tag [GC]
red/yellow ?
[GC]Toxik < Like this one
pawn Код:
public OnPlayerText(playerid,text[])
{
if(text[0] == '@') {
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"%s@: %s",string,text[1]); SendClientMessageToAll(-1,string);}else{
new Float: x ,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i,10.0,x,y,z))
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"%s Says:%s",string,text); SendClientMessage(i,-1,string);
}
}
}
}
}
Re: OnPlayerText & Colour Problems -
Jefff - 13.08.2015
pawn Код:
CheckTAG(playerid)
{
new Nick[MAX_PLAYER_NAME + 1],string[55];
GetPlayerName(playerid,Nick,sizeof(Nick));
if(!strcmp(Nick,"[GC]",true,4))
{
string = "{FF0000}[G{FFFF00}C]{33CCFF}";
strcat(string, Nick[4]);
return string;
}
strcat(string,Name);
return string;
}
and
pawn Код:
format(string,sizeof(string),"%s@: %s",CheckTAG(playerid),text[1]);
Re: OnPlayerText & Colour Problems -
Toxik - 13.08.2015
Quote:
Originally Posted by Jefff
pawn Код:
CheckTAG(playerid) { new Nick[MAX_PLAYER_NAME + 1],string[55]; GetPlayerName(playerid,Nick,sizeof(Nick)); if(!strcmp(Nick,"[GC]",true,4)) { string = "{FF0000}[G{FFFF00}C]{33CCFF}"; strcat(string, Nick[4]); return string; } strcat(string,Name); return string; }
and
pawn Код:
format(string,sizeof(string),"%s@: %s",CheckTAG(playerid),text[1]);
|
+repped Thanks