Bf read.ReadChar

From GMod Wiki

Jump to: navigation, search
Function
Syntax bf_read:ReadChar( )
Description:
Read a byte from the usermessage (-128 to 127)
Returns: Integer
In Object: Bf_read
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Bf read.ReadChar]Bf read.ReadChar [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionPrints the incoming char from an usermessage called SendChar
Used onNewerClient.png
Code
local function ReadChar(msg)
   local char = msg:ReadChar() -- reads the char
   print(char)
end
usermessage.Hook("SendChar", ReadChar)
OutputA char(number from -128 to 127) is printed in console


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox