diff options
Diffstat (limited to 'src/map/script-fun.cpp')
-rw-r--r-- | src/map/script-fun.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 0d211a7..07076d5 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -2957,8 +2957,6 @@ void builtin_smsg(ScriptState *st) { CharName player = stringish<CharName>(ZString(conv_str(st, &AARG(2)))); sd = map_nick2sd(player); - if (sd == nullptr) - return; } int type = HARG(1) ? conv_num(st, &AARG(0)) : 0; @@ -2972,6 +2970,22 @@ void builtin_smsg(ScriptState *st) } static +void builtin_remotecmd(ScriptState *st) +{ + dumb_ptr<map_session_data> sd = script_rid2sd(st); + if (HARG(1)) + { + CharName player = stringish<CharName>(ZString(conv_str(st, &AARG(1)))); + sd = map_nick2sd(player); + } + + ZString msg = ZString(conv_str(st, &AARG(0))); + if (sd == nullptr) + return; + clif_remote_command(sd, msg); +} + +static void builtin_music(ScriptState *st) { dumb_ptr<map_session_data> sd = script_rid2sd(st); @@ -3513,6 +3527,7 @@ BuiltinFunction builtin_functions[] = BUILTIN(npctalk, "ss?"_s, '\0'), BUILTIN(title, "s"_s, '\0'), BUILTIN(smsg, "e??"_s, '\0'), + BUILTIN(remotecmd, "s?"_s, '\0'), BUILTIN(music, "s"_s, '\0'), BUILTIN(mapmask, "i?"_s, '\0'), BUILTIN(getmask, ""_s, 'i'), |