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| | {{FuncDescription|Checks if a float value is nearly zero.}} | ||
{{FuncSyntax|IsFloatNearlyZero(Value)}} | {{FuncSyntax|IsFloatNearlyZero(Value)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|Value| | {{FuncParam|Value|The float value}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns '''true''' if success.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
if IsFloatNearlyZero(GetPlayerHealth()) then | |||
AddPlayerChat("You are about to die") | |||
end | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[RandomFloat]] | |||
* [[Base64Encode]] | |||
* [[Base64Decode]] | |||
* [[GetPlayerHealth]] | |||
* [[SetPlayerHealth]] | |||
* [[GetPlayerArmor]] | |||
* [[SetPlayerArmor]] |
Latest revision as of 17:50, 21 December 2019
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