diff options
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r-- | src/emap/script_buildins.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index e1c9123..93e9388 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -730,6 +730,32 @@ BUILDIN(setMapMask) return true; } +// sendMapMask(mask{, "player name"}) +BUILDIN(sendMapMask) +{ + const int val = script_getnum(st, 2); + + struct map_session_data *sd = NULL; + if (script_hasdata(st, 3) && script_isstringtype(st, 3)) + { + sd = script->nick2sd(st, script_getstr(st, 3)); + } + else + { + sd = script->rid2sd(st); + } + + if (sd == NULL) + { + ShowWarning("player not attached\n"); + script->reportsrc(st); + return false; + } + + send_mapmask(sd->fd, val); + return true; +} + BUILDIN(getMapMask) { const char *const mapName = script_getstr(st, 2); |