Bit return?
#1

what will return a bit ?

PHP код:
enum PlayerFlags:(<<= 1)
{
    ...,
    
IsHaveAdminRank3 3,
    ...
}
new 
PlayerFlags:g_PlayerFlags[MAX_PLAYERS];
#define BitFlag_CheckIt(%0,%1)        ( ( %0 ) & ( %1 ) )
switch(BitFlag_CheckIt(g_PlayerFlags[playerid], IsHaveAdminRank3))
    {
        case 
0:
        {
            
SendClientMessageplayerid0x55AADDFF"0");
        }
        case 
1:
        {
            
SendClientMessageplayerid0x55AADDFF"1");
        }
        case 
2:
        {
            
SendClientMessageplayerid0x55AADDFF"2");
        }
        case 
3:
        {
            
SendClientMessageplayerid0x55AADDFF"3");
        }
        case 
4:
        {
            
SendClientMessageplayerid0x55AADDFF"4");
        }
        case 
5:
        {
            
SendClientMessageplayerid0x55AADDFF"5");
        }
        case 
6:
        {
            
SendClientMessageplayerid0x55AADDFF"6");
        }
        case 
7:
        {
            
SendClientMessageplayerid0x55AADDFF"7");
        }
        case 
8:
        {
            
SendClientMessageplayerid0x55AADDFF"8");
        }
        case 
9:
        {
            
SendClientMessageplayerid0x55AADDFF"9");
        }
        case 
10:
        {
            
SendClientMessageplayerid0x55AADDFF"10");
        }
        default:
        {
            
SendClientMessageplayerid0x55AADDFF"Este un Bit Hax orice");
        }
    } 
I will need to switch to case 0b00000001 ?...
Reply
#2

1, 2, 4, 8, 16, 32, 64, etc
1, 2, 3, 4, 5, 6, 7, etc...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)