IsFloatNearlyZero: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|IsFloatNearlyZero(Value)}} {{FuncParameters}} {{FuncParam|Value|__EDIT_ME__}} {{FuncReturnValue|_...")
 
m (more see also links)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Info|Function|Client|1.0}}
{{Info|Function|Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Checks if a float value is nearly zero.}}


{{FuncSyntax|IsFloatNearlyZero(Value)}}
{{FuncSyntax|IsFloatNearlyZero(Value)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|Value|__EDIT_ME__}}
{{FuncParam|Value|The float value}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns '''true''' if success.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
if IsFloatNearlyZero(GetPlayerHealth()) then
AddPlayerChat("You are about to die")
end
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
* [[RandomFloat]]
* [[Base64Encode]]
* [[Base64Decode]]
* [[GetPlayerHealth]]
* [[SetPlayerHealth]]
* [[GetPlayerArmor]]
* [[SetPlayerArmor]]

Latest revision as of 17:50, 21 December 2019

IsFloatNearlyZero

Type: Function
Context: Client
Introduced: v1.0

Description

Checks if a float value is nearly zero.

Syntax

IsFloatNearlyZero(Value)

Parameters

  • Value
    The float value

Return Value

  • Returns true if success.

Example

if IsFloatNearlyZero(GetPlayerHealth()) then
	AddPlayerChat("You are about to die")
end

See also