summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-12 02:18:53 -0200
committershennetsind <ind@henn.et>2013-02-12 02:18:53 -0200
commit20abc4a94a4bd3a7428c042cc6d1c313272fbc28 (patch)
treec03c87e49d48e2e9c891f76bebd19c5bacea27d0 /src
parent16859820551f61bf26a99139fd6e4fd9425f1154 (diff)
parente56ad900704299c53c55b8c6fd5cfc958b712090 (diff)
downloadhercules-20abc4a94a4bd3a7428c042cc6d1c313272fbc28.tar.gz
hercules-20abc4a94a4bd3a7428c042cc6d1c313272fbc28.tar.bz2
hercules-20abc4a94a4bd3a7428c042cc6d1c313272fbc28.tar.xz
hercules-20abc4a94a4bd3a7428c042cc6d1c313272fbc28.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index a6d588113..b89121ee4 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -14968,6 +14968,23 @@ BUILDIN_FUNC(checkchatting) // check chatting [Marka]
return 0;
}
+BUILDIN_FUNC(checkidle)
+{
+ TBL_PC *sd = NULL;
+
+ if (script_hasdata(st, 2))
+ sd = map_nick2sd(script_getstr(st, 2));
+ else
+ sd = script_rid2sd(st);
+
+ if (sd)
+ script_pushint(st, DIFF_TICK(last_tick, sd->idletime));
+ else
+ script_pushint(st, 0);
+
+ return 0;
+}
+
BUILDIN_FUNC(searchitem)
{
struct script_data* data = script_getdata(st, 2);
@@ -17689,6 +17706,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(roclass,"i?"), //[Skotlex]
BUILDIN_DEF(checkvending,"?"),
BUILDIN_DEF(checkchatting,"?"),
+ BUILDIN_DEF(checkidle,"?"),
BUILDIN_DEF(openmail,""),
BUILDIN_DEF(openauction,""),
BUILDIN_DEF(checkcell,"siii"),