Quote:
Originally posted by R0bin
the numbers would have to be like this:
1 - Trial
2 - Classic
4 - Gold
8 - VIP
bitflags, see showstats, enablefeatures.
So no two numbers added could be equal to another bitflag.
e.g, 1+2 = 3, 1+2+4 = 7, etc.
|
Put it this way:
If you want all players with Gold or VIP, and not, you could do:
NPC Code:
bitflag = 4+8;
if (accounttype == bitflag){
message YOUR IN!;
}
Whereas elsewise, you'd have to say:
NPC Code:
bitflag = {2,3};
if (accounttype in bitflag){
message Your In!;
}
The first method is more effiecent with the engine, whereas the second one is still easily done.
Most people would put:
NPC Code:
if (accounttype == 2 || accounttype == 3){
message Your In!;
}
And... That way looks ugly. To prevent ugliness, they use bitflags.
Personally, I don't mind either way.