Bit return? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bit return? (
/showthread.php?tid=300853)
Bit return? -
Night Dreamer - 02.12.2011
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:
{
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");
}
}
I will need to switch to case 0b00000001 ?...
Re: Bit return? -
ToToRo - 02.12.2011
1, 2, 4, 8, 16, 32, 64, etc
1, 2, 3, 4, 5, 6, 7, etc...