[Help] PlayerColor
#1

Hello , following is my PlayerTextcolor code . It send the message in another color which player chooses . but it set playercolor to black . I want to remove this function . So that player color don't get black and will be the same .

PHP код:
        new
        
temp_String[144],
        
temp_Nick[MAX_PLAYER_NAME];
        
GetPlayerName(playeridtemp_Nicksizeof(temp_Nick));
        
format(temp_Stringsizeof(temp_String), "%s : {%06x}%s"temp_Nickg_PlayerChatCol[playerid] >>> 8text);
        
SendClientMessageToAll(GetPlayerColor(playerid), temp_String);
        return 
0//To avoid the original chat to be sent. 
Thanks to a Sa-mp member who gave me this code . I forgot his name.
Reply
#2

It's because g_PlayerChatCol[playerid] variable is set to 0 by default. Just add this to the end of OnPlayerConnect:
pawn Код:
g_PlayerChatCol[playerid] = 0xFFFFFFFF;
Reply
#3

I think you gave me the code Lordzy .
But i have also color name changer option by /colors so i want that if player say anything his color will be the same as he choose from /colors.
Reply
#4

try this
format(temp_String, sizeof(temp_String), "{%06x}%s : {%06x}%s",GetPlayerColor(), temp_Nick, g_PlayerChatCol[playerid], text);
SendClientMessageToAll(-1,temp_String);
Reply
#5

GetPlayerColor() - It will return black color in case if SetPlayerColor hasn't been used. You must use SetPlayerColor either under OnPlayerRequestClass or under OnPlayerSpawn.
Reply
#6

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
It's because g_PlayerChatCol[playerid] variable is set to 0 by default. Just add this to the end of OnPlayerConnect:
pawn Код:
g_PlayerChatCol[playerid] = 0xFFFFFFFF;
I already did it.
PHP код:
g_PlayerChatCol[playerid] = 0xFFFFFFFF//By default, it's white. 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)