21.05.2012, 22:25
(
Последний раз редактировалось Jonny5; 22.05.2012 в 05:27.
)
what do you want todo with this info?
its basic an 32 bit cell,
and each bit stores a different "Flag" so to say,
so let me comment their door example and see if we can make this clear,
from the wiki
//this is read from right to left
okay so now we know what each BYTE represents.
lets look at each BIT their are 8 per byte but we will only use
the first 3(right 3)
from the wiki
so for any of the bytes we want to affect we set the bits for
so i will break it down for one byte
starting with the right most bit
now if you don't know about how to set these bits or binary numbers in general
you'll probably need to read up on that before this is clear. But i think
if you got the tires down this wont be to hard for ya.
and if you have any more question please ask,
I will explain as much as i can. The wiki don't explain the lights
at all so that one might be harder,
but i'm sure it is similar to the doors and could be figured out
with enough time and trial/error.
regards
hope this helps
EDIT:
just for your ref,
im making as set of function to make this easy,
heres what my enum looks like for all the bit for the doors
its basic an 32 bit cell,
and each bit stores a different "Flag" so to say,
so let me comment their door example and see if we can make this clear,
from the wiki
Код:
The first byte stores the state of the hood The second byte stores the state of the trunk The third byte stores the state of the drivers door The fourth byte stores the state of the co-drivers door
pawn Код:
//byte 4 byte 3 byte 2 byte 1
00000001 00000010 00000011 00000100
co-drivers drivers trunk hood
lets look at each BIT their are 8 per byte but we will only use
the first 3(right 3)
from the wiki
Код:
The first bit stores whether the door is opened(1) or not(0) (the door will still lock (and change the first bit to 0) if closed - its just open) The second bit stores whether the door is damaged(1) or not(0) (If you want a damaged door to turn normal you have to remove and re-attach it undamaged) The third bit stores whether the door is removed(1) or attached(0) The rest of the bits are empty
so i will break it down for one byte
starting with the right most bit
pawn Код:
00000001 //set the door to open
00000010 //set door to be damaged
00000100 //set door to be detached
00000011 //set the door to be opened and damaged.
you'll probably need to read up on that before this is clear. But i think
if you got the tires down this wont be to hard for ya.
and if you have any more question please ask,
I will explain as much as i can. The wiki don't explain the lights
at all so that one might be harder,
but i'm sure it is similar to the doors and could be figured out
with enough time and trial/error.
regards
hope this helps
EDIT:
just for your ref,
im making as set of function to make this easy,
heres what my enum looks like for all the bit for the doors
pawn Код:
enum
{
evdHood_Opened = 1,
evdHood_Damaged = 2,
evdHood_Removed = 4,
evdTrunk_Opened = 256,
evdTrunk_Damaged = 512,
evdTrunk_Removed = 1024,
evdDriver_Opened = 65536,
evdDriver_Damaged = 131072,
evdDriver_Removed = 262144,
evdPassenger_Opened = 16777216,
evdPassenger_Damaged = 33554432,
evdPassenger_Removed = 67108864
}
//and for the lights
enum
{
evdLights_Drivers = 1,
evdLights_Passengers = 4,
evdLights_Rear = 64
}