G.tobool

From GMod Wiki

Jump to: navigation, search
Function
Syntax tobool( Var value )
Where is this used?
Description:
Attempts to cast the argument as a bool.
Returns: Boolean
Part of Library: Global Functions
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=G.tobool]G.tobool [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSome acceptable usages.
Used onNewerShared.png
Code
print( tobool( true ) )
print( tobool( 1 ) )
print( tobool( 0 ) )
print( tobool( "true" ) )
print( tobool( "false" ) )
Output
true
true
false
true
false


Additional Info

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox