Garry's Mod Wiki

bf_read

This is the object passed to usermessage.Hook when a message is received. It contains each value stored in the message in sequential order. You should read values from it in the order you wrote them.

We advise against using this. It may be changed or removed in a future update. You should be using net instead

Methods

Angle bf_read:ReadAngle()
Reads and returns an angle object from the bitstream.
boolean bf_read:ReadBool()
Reads 1 bit and returns a bool representing the bit.
number bf_read:ReadChar()
Reads a signed char and returns a number from -127 to 127 representing the ascii value of that char.
Entity bf_read:ReadEntity()
Reads a short representing an entity index and returns the matching entity handle.
number bf_read:ReadFloat()
Reads a 4 byte float from the bitstream and returns it.
number bf_read:ReadLong()
Reads a 4 byte long from the bitstream and returns it.
number bf_read:ReadShort()
Reads a 2 byte short from the bitstream and returns it.
string bf_read:ReadString()
Reads a null terminated string from the bitstream.
Vector bf_read:ReadVector()
Reads a special encoded vector from the bitstream and returns it, this function is not suitable to send normals.
Reads a special encoded vector normal from the bitstream and returns it, this function is not suitable to send vectors that represent a position.
bf_read:Reset()
Rewinds the bitstream so it can be read again.