cookie.GetNumber

From GMod Wiki

Jump to: navigation, search
Function
Syntax cookie.GetNumber( String Name, Number Default )
Where is this used?
Description:
Gets the value of a cookie as a number. Returns Default if the cookie is not found.
Returns: Number
Part of Library: cookie
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Cookie.GetNumber]Cookie.GetNumber [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

Descriptionsets cookie MyAge to 4 and prints it
Used onNewerClient.png
Code
 
cookie.Set("MyAge", 4)
local age = cookie.GetNumber("MyAge")
print("My age is " .. age)
 
OutputMy age is 4


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox