SA-MP Forums Archive
Need Help Here - 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: Need Help Here (/showthread.php?tid=660792)



Need Help Here - PoniStar - 13.11.2018

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



Re: Need Help Here - JaskaranSingh - 13.11.2018

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


Re: Need Help Here - PoniStar - 13.11.2018

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


Re: Need Help Here - d3ll - 13.11.2018

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



Re: Need Help Here - PoniStar - 13.11.2018

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


Re: Need Help Here - BiGuy - 13.11.2018

add the 0x and FF again


Re: Need Help Here - PoniStar - 13.11.2018

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


Re: Need Help Here - d3ll - 13.11.2018

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;