From b7a9760e769738058ddbd99bc56d809de26ee99a Mon Sep 17 00:00:00 2001 From: Joseph Botosh Date: Mon, 28 Sep 2015 12:04:09 +0300 Subject: add abs(N) function --- npc/functions/main.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'npc/functions/main.txt') diff --git a/npc/functions/main.txt b/npc/functions/main.txt index d510f05b..a9edd4a1 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -158,3 +158,9 @@ function script npcdebug { debugmes strnpcinfo(3) + ": " + getarg(0); return; } + + +function script abs { + .@n = getarg(0); + return .@n >= 0 ? .@n : -.@n; +} -- cgit v1.2.3-60-g2f50