bits return slot
#1

I have
PHP код:
new bitsvaribile[MAX_PLAYERS];
enum E_bitsSlot
{
    
fristSlotIsThis 1,
    
theRestOfThem,
    ...
    
utilTheLastOne
};
#define BitCheck(%1,%2)    ( ( bitsvaribile[%1] ) &   ( 1 << %2 ) ) 
so with that I can return true or false... but insted of that I wana to return the %2 that is slot from the enum...
Reply
#2

Why do you want to return %2 if you already know it
pawn Код:
if(BitCheck(playerid, fristSlotIsThis)) {}
So this should return fristSlotIsThis ?
Reply
#3

nice try but I wana new one
PHP код:
if(BitCheckSlot(playerid) == fristSlotIsThis
Reply
#4

That would only work if you only set one bit at once but I dont think that this is what you want

The easiest method would be a loop through all bits but there are some other methods like this

http://forum.sa-mp.com/showpost.php?...postcount=2683

This function returns the bit position (0 - 31)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)