Need Help Here
#1

hi guys so i just wanted to know how can i do something like this :

Код:
new string[128];
format(string,sizeof(string),"%s",PlayerInfo[playerid][ChatColor]);
SendClientMessage(playerid, string, str);
so i cant use string for COLOR , i want to server get the color from player stats file ! i created a command to change this color so the code should read the player account file and replace chat color with the color of sendclientmssg

here is that command code
Код:
dcmd_ccolor(playerid, params[])
{
    new colord[64];
    if(sscanf(params, "si", colord))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE : /Ccolor (ColorCode 0xRRGGBBAA)");
        return 1;
    }
	format(PlayerInfo[playerid][ChatColor], 10, colord);
	SavePlayer(playerid);
	return 1;
}
Reply
#2

PHP код:
format(string,sizeof(string),"{%s}",PlayerInfo[playerid][ChatColor]); 
Now, remove 0x and AA (the alpha values). Keep only the RGB part (FF00EE)
Reply
#3

thnx but i want the time get color too [/timestamp] with {} just text will get color
Reply
#4

pawn Код:
SendClientMessage(playerid, PlayerInfo[playerid][ChatColor], "Insert text here");
Reply
#5

Quote:
Originally Posted by d3ll
Посмотреть сообщение
pawn Код:
SendClientMessage(playerid, PlayerInfo[playerid][ChatColor], "Insert text here");
just show it as block color :\
Reply
#6

add the 0x and FF again
Reply
#7

i fixed it on hard way -_- thnx guys! solved
Reply
#8

PHP код:
dcmd_ccolor(playeridparams[])
{
    new 
colord;
    if(
sscanf(params"i"colord)) 
        return 
SendClientMessage(playerid,COLOR_ERROR,"USAGE : /Ccolor (ColorCode 0xRRGGBBAA)");
    
PlayerInfo[playerid][ChatColor] = colord;
    
SavePlayer(playerid);
    
SendClientMessage(playeridcolord"This is the colour of your new text!");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)