02.12.2011, 09:45
what will return a bit ?
I will need to switch to case 0b00000001 ?...
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:
{
SendClientMessage( playerid, 0x55AADDFF, "0");
}
case 1:
{
SendClientMessage( playerid, 0x55AADDFF, "1");
}
case 2:
{
SendClientMessage( playerid, 0x55AADDFF, "2");
}
case 3:
{
SendClientMessage( playerid, 0x55AADDFF, "3");
}
case 4:
{
SendClientMessage( playerid, 0x55AADDFF, "4");
}
case 5:
{
SendClientMessage( playerid, 0x55AADDFF, "5");
}
case 6:
{
SendClientMessage( playerid, 0x55AADDFF, "6");
}
case 7:
{
SendClientMessage( playerid, 0x55AADDFF, "7");
}
case 8:
{
SendClientMessage( playerid, 0x55AADDFF, "8");
}
case 9:
{
SendClientMessage( playerid, 0x55AADDFF, "9");
}
case 10:
{
SendClientMessage( playerid, 0x55AADDFF, "10");
}
default:
{
SendClientMessage( playerid, 0x55AADDFF, "Este un Bit Hax orice");
}
}