Posts: 737
Threads: 338
Joined: Jan 2013
Hi,
How for ex, from this color:
0x808080AA
Get
0x80808000
I mean any color, change last symbols to 00
Posts: 1,767
Threads: 124
Joined: Mar 2010
Last symbols are called ALPHA values. This is a HEX code and its colors are defined by RRGGBBAA. And what do you mean by get color? You want to store your color to the variable and then substract some amount from that or what?
0xRRGGBBAA
0xREDREDGREENGREENBLUEBLUEALPHAALPHA
Posts: 450
Threads: 10
Joined: May 2014
Reputation:
0
Last symbol to FF will be the best.
Posts: 1,767
Threads: 124
Joined: Mar 2010
Quote:
Originally Posted by Rittik
Last symbol to FF will be the best.
|
Do you actually even know what he means, and what you're trying to do? You just simply told him to change ALPHA value to FF which will remove whole transparency. But the point is, that we actually don't know what he's trying to achieve. I would treat your post as spam.
Posts: 737
Threads: 338
Joined: Jan 2013
I want to convert, because i have GetPlayerColor, and there is dark red, i need to get that color where transparenty will be 00.
Posts: 1,767
Threads: 124
Joined: Mar 2010
In that case, if I get you rightly, you need to set your alpha values to FF which will remove any transparency from your color.
So, your color will become this:
https://sampwiki.blast.hk/wiki/Colors_List
Posts: 737
Threads: 338
Joined: Jan 2013
No... I can have any color i said GetPlayerColor, color player can be a lot of. That'is why i want to convert GetPlayerColor > To the same color, but transperety how i said will be 00. Like example.
if i getplayercolor is 0xFFFFFFAA
Then with function with i need i convert this to
0xFFFFFF00
Posts: 1,767
Threads: 124
Joined: Mar 2010
It will remove your transparency, players won't be visible at mini-map. Is that what you want?
Simply, you're saying now to have your colors (all of them) but change alpha value to '00' ? So color will still be there, but players will not be visible at the map?
First of all, you gonna need fix of the colors to achieve that:
https://sampwiki.blast.hk/wiki/ColorFix
And then in SetPlayerColor function change alpha channel to '00'. That's it.
Posts: 737
Threads: 338
Joined: Jan 2013
Don't care where i do them.. Just i need to know code. I don't convert all colors to 00, and i don't need that. I said color can be any! that'is why i need to use GetPlayerColor, but i need convert it to the same color but end will be 00, because i need that color from player color i will use there in other way. I need function, stock where i can put player getplayercolor, and there will convert my into color. No write my self or other shit.
Posts: 737
Threads: 338
Joined: Jan 2013
I have to use that:
Code:
(GetPlayerColor(playerid) & ~0xFF) | clamp(0x00, 0x00, 0xFF)
Posts: 737
Threads: 338
Joined: Jan 2013
If i set player color, simple. But marker i will use
SetPlayerMarkerForPlayer(playerid, Nextplayerid, ( GetPlayerColor( Nextplayerid ) & 0xFFFFFF00 ) );
Posts: 737
Threads: 338
Joined: Jan 2013
Code:
new NERODNAQWEFF;
foreach(NERODNAQWEFF : Player)
{
SetPlayerMarkerForPlayer(playerid, NERODNAQWEFF, ( GetPlayerColor( NERODNAQWEFF ) & 0xFFFFFF00 ) );
}
I still see player markers.. I add this script onplayerspawn, if say more accurate when player spawn, and when i load player, from database then i use this script. But i still able to see every marker.. HOw this possible?
Posts: 737
Threads: 338
Joined: Jan 2013
But why my script don't work?
Posts: 737
Threads: 338
Joined: Jan 2013
What variable? why ID 0, if i do cikle thru all players