30.01.2014, 11:32
Normal variable in pawn (called cell) has 32 bits. Without using bit flags you can't access any part smaller than 8 bits at once (and to get 8, you have to use packed strings). With bit operations you can access any bit you want. https://sampforum.blast.hk/showthread.php?tid=216730 - take a look at "bit-flags in enums", that's real world example.
Also it's handy for colors manipulation - https://sampforum.blast.hk/showthread.php?tid=200876
Also when your script reaches complexity of at least O(n^2), even smallest optimisations can really speed things up.
Also it's handy for colors manipulation - https://sampforum.blast.hk/showthread.php?tid=200876
Also when your script reaches complexity of at least O(n^2), even smallest optimisations can really speed things up.