The online racing simulator
spr - player flags
(3 posts, started )
spr - player flags
Hi

I can't find about player flags in spr file. I'm reading this file using php. I'm reading byte by byte so because player flags is word (word: 2-byte integer) after read I have two numbers:

fseek($stream,132);
$player_flags1 = hexdec(bin2hex(fread($stream,1)));
fseek($stream,133);
$player_flags2 = hexdec(bin2hex(fread($stream,1)));

$player_flags1 stores first byte .. $player_flags2 stores second byte. How to split them?
For example from my file:
$player_flags1 = 1
$plyer_flags2=6

result is 16 or 7 or ??

LEFT HAND DRIVE 1
GEAR CHANGE CUT 2
GEAR CHANGE BLIP 4
AUTO SHIFT 8
SHIFTER 16
RESERVED 32


After split how to read flags using those rules?

--
Best regards
Tomasz Zakrecki
Take a look at the unpack function, which is part of PHP by default. That should help you out.
tnx, it works

spr - player flags
(3 posts, started )
FGED GREDG RDFGDR GSFDG