summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index b321541..fd54d5b 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -1097,3 +1097,24 @@ BUILDIN(setMount)
return true;
}
+
+BUILDIN(clientCommand)
+{
+ TBL_PC* sd = script->rid2sd(st);
+
+ if (sd == NULL)
+ {
+ ShowWarning("player not attached\n");
+ script->reportsrc(st);
+ return false;
+ }
+ const char *const command = script_getstr(st, 2);
+ if (!command)
+ {
+ ShowWarning("invalid client command\n");
+ script->reportsrc(st);
+ return false;
+ }
+ send_client_command(sd, command);
+ return true;
+}