getplayercolor and bits
#1

That is a very very very interessting topic
Can you explain me please what that do?
Код:
printf("%02x%06x", ih >>> 24, ih & 0x00FFFFFF);
I found it here: http://forum.sa-mp.com/index.php?top...0537#msg280537

I think...
for example ih = getplayercolor(playerid) //0xff0000ff with setplayercolor.
Now it looks in binary like this:
Код:
11111111 11111111 00000000 00000000 00000000 00000000 11111111 11111111 = FF 00 00 FF
Now bitshifting logical right(24):
Код:
00000000 00000000 00000000 11111111 11111111 00000000 00000000 00000000 = 00 0F F0 00
Now binary AND:
Код:
00000000 00000000 00000000 11111111 11111111 00000000 00000000 00000000 = 00 0F F0 00
Thats my result, but thats wrong :/
The code
Код:
printf("%02x%06x", ih >>> 24, ih & 0x00FFFFFF);
work perfecly but i cant understand it.
Can you please tell me what i think wrong?

Thanks

//EDIT
PLEASE EXPLAIN

Sry for doublelpost, but i think that no one saw this: http://forum.sa-mp.com/index.php?top....msg630072#new
Reply
#2

Patience is a virtue.
Reply
#3

Well yes of course.. i know i know i know, sry
But lol thats funny.... i don't really need a answer, because the code work perfectly.
That only think i want, is a explain what it do.

I mean.. i will understand what i do!
Not only copy/paste without information about the workprocess.

Greetings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)