summaryrefslogtreecommitdiff
path: root/functions.lua
diff options
context:
space:
mode:
authorBrandon <brandon@bremaweb.com>2014-02-22 14:30:33 -0600
committerBrandon <brandon@bremaweb.com>2014-02-22 14:30:33 -0600
commit38f06a8df0a8accefedbd1b10e5a22f9ae2b13a2 (patch)
treef62b40efbbed2cb4b01d1edb59408c14268b3ac5 /functions.lua
parentcd75c51451cc99cc969bb02159076dc3ab9ba69b (diff)
add time options for who to ban and damage
Diffstat (limited to 'functions.lua')
-rw-r--r--functions.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/functions.lua b/functions.lua
index 92cad80..839c814 100644
--- a/functions.lua
+++ b/functions.lua
@@ -44,11 +44,18 @@ function landrush.get_owner(pos)
end
function landrush.get_distance(pos1,pos2)
-
if ( pos1 ~= nil and pos2 ~= nil ) then
return math.abs(math.floor(math.sqrt( (pos1.x - pos2.x)^2 + (pos1.z - pos2.z)^2 )))
else
return 0
end
+end
+function landrush.get_timeonline(name)
+ -- a wrapper for whoison.getTimeOnline since whoison is an optional dependancy
+ if ( landrush.whoison == true ) then
+ return (whoison.getTimeOnline(name) / 60)
+ else
+ return -1
+ end
end