Module - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Module (
/showthread.php?tid=529628)
Module -
Banditukas - 03.08.2014
Hi,
What sa-mp function make a number like -5 to a positive number? like |-5|=5
Re: Module -
SickAttack - 03.08.2014
pawn Код:
stock PositiveConversion(val)
{
if(val < 0) val *= -1;
return val;
}
Re: Module -
Lordzy - 03.08.2014
https://sampwiki.blast.hk/wiki/Floatabs
Re: Module -
SlimDkhili - 03.08.2014
i think there a function named sqr or sqrt ... ******
Re: Module -
dirigent00 - 03.08.2014
Quote:
Originally Posted by Lordzy
|
That will work for float, but what about integer? Check if the number is negative, and then mulitple it with -1.
Код:
if(number < 0)
{
number = number * (-1);
}