OnPlayerText & Colour Problems
#1

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);
}
}
}
}
}
Reply
#2

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]);
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)