is it even possible? -
KaleOtter - 06.10.2011
Example:
new Hexcolor[26];
format(Hexcolor,26,"#33CC00");
SetPlayerColor(playerid,Hexcolor);
Is this even possible?
Because it only makes my name black...
Maybe stupid question but I get sick of this day, everything goes wrong...
Re: is it even possible? -
park4bmx - 06.10.2011
you do it like this
pawn Код:
#define Hexcolor "{33CC00}"
SetPlayerColor(playerid,Hexcolor);
Re: is it even possible? -
KaleOtter - 06.10.2011
No, because it's for family's, and I want to be able to change the colors ingame.
I don't ask how else I can do it, but I just ask if this is even possible.
Re: is it even possible? -
park4bmx - 06.10.2011
in that case you can use numbers for a color which they will be stored as variable
and just used it like example im using this
pawn Код:
GangZoneShowForAll(id,16711888);
this makes my gangzone to blue with abit of transparent in it
EDIT:
another example
pawn Код:
new Color = GetPVarInt(playerid, "16711888");
SetPlayerColor(playerid,Color);
Re: is it even possible? -
KaleOtter - 06.10.2011
Uhm well I tested that too, but I gues that didn't work because I put the numbers inside a string, I'm going to try it again.
Re: is it even possible? -
KaleOtter - 06.10.2011
Thanks for the help, it works.
Re: is it even possible? -
KaleOtter - 06.10.2011
wierd, the decimal color codes doesn't get the color it should be I tried 10 different sites with hex en dec colors, but I gues that's a sa-mp bug.(again)
Re: is it even possible? -
Pharrel - 06.10.2011
use infernus pawn editor...he got a color picker
RR GG BB AA
just with numbers will be like...
99000000 = transparent red
00990000 = transparent green
00009900 = transparent blue
99009900 = transparent purple
99999900 = transparent grey
00999900 = transparent lightblue
transparent means that will not show the markers in map..if you want to show the markers just replace the last 00 for 99
Re: is it even possible? -
Jeffry - 06.10.2011
For your command this might be helpful:
https://sampwiki.blast.hk/wiki/Colors_Li...alue_with_pawn
Re: is it even possible? -
IstuntmanI - 06.10.2011
Use this function:
pawn Код:
stock hexstr( string[ ] ) // Function by ******
{
new ret, val, i;
if( string[ 0 ] == '0' && ( string[ 1 ] == 'x' || string[ 1 ] == 'X' ) ) i = 2;
while( string[ i ] )
{
ret <<= 4;
val = string[ i ++ ] - '0';
if( val > 0x09 ) val -= 0x07;
if( val > 0x0F ) val -= 0x20;
if( val < 0x01 ) continue;
if( val < 0x10 ) ret += val;
}
return ret;
}
Use like this:
Код:
new Hexcolor[ 26 ];
format( Hexcolor, 26, "#33CC00" );
SetPlayerColor( playerid, hexstr( Hexcolor ) );