From SA-MP Wiki

Jump to: navigation, search


Image:Farm-Fresh text lowercase.png Note: This function name starts with a lowercase letter.


floatcmp can be used to compare float values to each other, to validate the comparison.

(Float:oper1, Float:oper2)
oper1The first float value to compare.
oper2The second float value to compare.

Return Values:

0 if value does match, 1 if the first value is bigger and -1 if the 2nd value is bigger.

Example Usage:

floatcmp(2.0, 2.0); // Returns 0 because they match.
floatcmp(1.0, 2.0) // Returns -1 because the second value is bigger.
floatcmp(2.0, 1.0) // Returns 1 because the first value is bigger.
Personal tools