summaryrefslogtreecommitdiff
path: root/npc/functions/main.txt
diff options
context:
space:
mode:
authorJoseph Botosh <rumly111@gmail.com>2015-09-28 12:04:09 +0300
committerJoseph Botosh <rumly111@gmail.com>2015-09-28 12:04:09 +0300
commitb7a9760e769738058ddbd99bc56d809de26ee99a (patch)
treecc124e5672de00cde6441a331beed88c9012f107 /npc/functions/main.txt
parent9ec237dbbb1b60df6bb17604520b6e546c5dd920 (diff)
downloadserverdata-b7a9760e769738058ddbd99bc56d809de26ee99a.tar.gz
serverdata-b7a9760e769738058ddbd99bc56d809de26ee99a.tar.bz2
serverdata-b7a9760e769738058ddbd99bc56d809de26ee99a.tar.xz
serverdata-b7a9760e769738058ddbd99bc56d809de26ee99a.zip
add abs(N) function
Diffstat (limited to 'npc/functions/main.txt')
-rw-r--r--npc/functions/main.txt6
1 files changed, 6 insertions, 0 deletions
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;
+}