error 001: expected token: "-identifier-", but found "(" - 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: error 001: expected token: "-identifier-", but found "(" (
/showthread.php?tid=624232)
-- DELETED -- -
danielpalade - 13.12.2016
-- DELETED --
Re: error 001: expected token: "-identifier-", but found "(" -
BiosMarcel - 13.12.2016
The mistake lies somewhere else, but the compiler isn't able to realize that, search somewhere else, something that you have recently changed
Re: error 001: expected token: "-identifier-", but found "(" -
GoldenLion - 13.12.2016
https://sampwiki.blast.hk/wiki/Floatabs
Re: error 001: expected token: "-identifier-", but found "(" -
Vince - 13.12.2016
That's for floats. There's nothing wrong with the function itself (although it can be written shorter, see below) so you probably placed it in the wrong spot.
PHP код:
stock abs(value)
return (value < 0) ? -value : value;
Re: error 001: expected token: "-identifier-", but found "(" -
GoldenLion - 13.12.2016
Quote:
Originally Posted by Vince
That's for floats. There's nothing wrong with the function itself (although it can be written shorter, see below) so you probably placed it in the wrong spot.
PHP код:
stock abs(value)
return (value < 0) ? -value : value;
|
Yes, but you can use floatabs with integers as well. All you need to do is round it after getting it's absolute value.