From cc34f468f064797d21225d84377ae8358c4f90a4 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Thu, 8 Sep 2005 15:24:28 +0000 Subject: [PATCH] Added a new math stock function. --- plugins/include/amxmisc.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/include/amxmisc.inc b/plugins/include/amxmisc.inc index cd4c17bb..265e2639 100755 --- a/plugins/include/amxmisc.inc +++ b/plugins/include/amxmisc.inc @@ -191,3 +191,16 @@ stock AddMenuItem_call(const MENU_TEXT[], const MENU_CMD[], const MENU_ACCESS, c callfunc_end() } + + +stock gaben(low, high, seed, offset) +{ + new numElements = high - low + 1; + offset += seed - low; + + if (offset >= 0) + return low + (offset % numElements); + else + return high - (abs(offset) % numElements) + 1; + return 0; // Makes the compiler happy -_- +}