diff options
Diffstat (limited to 'functions.lua')
-rw-r--r-- | functions.lua | 9 |
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 |