14.06.2011, 11:26
(
Последний раз редактировалось MrDeath537; 14.06.2011 в 13:32.
)
[Include] DBits 1.1
> created by MrDeath537
Introduction:
This include allow us to create 16 and 8 bit arrays, you've to download it and put on "pawno\includes\" then include it on your script as:
Creating variables:
Use the following syntax:
Functions:
Posible uses:
The main usage would be saving memory, why should you waste the double memory (if you need 16-bit variables) or the quadruple (if you need 8-bit variables) if you can use the right one and save memory?
Limits:
8-bits, maximum variable size: 256.
16-bits, maximum variable size: 65536.
Notes:
- It's impossible to create a single 8-bit or 16-bit variable, but not arrays, because this include uses "normal" variables.
- The 8-bit variables uses char-arrays.
- I did some tests and I didn't find any bug, please tell me if you find one.
Download:
Pastebin - First release
Pastebin - Update 1.1
> created by MrDeath537
Introduction:
This include allow us to create 16 and 8 bit arrays, you've to download it and put on "pawno\includes\" then include it on your script as:
pawn Код:
#include <DBits>
Creating variables:
Use the following syntax:
Код:
new Bit16:variable<size>, Bit8:variable<size>;
Functions:
- Bit8_Get(variable[], slot):
Returns the value of the specified slot on the variable. - Bit8_Set(variable[], slot, value):
Sets the value of the specified slot on the variable. - Bit16_Get(variable[], slot):
Returns the value of the specified slot on the variable. - Bit16_Set(variable[], slot, value):
Sets the value of the specified slot on the variable.
Posible uses:
The main usage would be saving memory, why should you waste the double memory (if you need 16-bit variables) or the quadruple (if you need 8-bit variables) if you can use the right one and save memory?
Limits:
8-bits, maximum variable size: 256.
16-bits, maximum variable size: 65536.
Notes:
- It's impossible to create a single 8-bit or 16-bit variable, but not arrays, because this include uses "normal" variables.
- The 8-bit variables uses char-arrays.
- I did some tests and I didn't find any bug, please tell me if you find one.
Download:
Pastebin - First release
Pastebin - Update 1.1