diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-04-10 03:00:20 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-04-10 03:00:20 -0300 |
commit | ba1e827b6b4c17c35a163e6b55be8c122de632b8 (patch) | |
tree | 819f93d0ffee3697e336471710afb9681f0b8d86 /npc/commands/remotecmd.txt | |
parent | 6e7f3113c0faad9edd4367d100ba9dd77e8d3130 (diff) | |
download | serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.gz serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.bz2 serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.xz serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.zip |
Add several convenience functions. Fix some bugs regarding misuse of readparam()
Diffstat (limited to 'npc/commands/remotecmd.txt')
-rwxr-xr-x | npc/commands/remotecmd.txt | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/npc/commands/remotecmd.txt b/npc/commands/remotecmd.txt deleted file mode 100755 index 20f33f8c..00000000 --- a/npc/commands/remotecmd.txt +++ /dev/null @@ -1,61 +0,0 @@ -- script @remotecmd NPC32767,{ - callfunc "argv_splitter"; - if (GM < CMD_REMOTECMD && GM < G_SYSOP) goto L_GM; // check if you can use it on self - .@target_id = BL_ID; - .@t$ = @argv$[1]; - setarray @remotecmd[0], 0, 1, 1; // nr, to_self, multi_target - if (.@t$ == "map") goto L_Map; - if (.@t$ == "map!") goto L_AllMap; - if (.@t$ == "area") goto L_Area; - if (.@t$ == "area!") goto L_AllArea; - if (.@t$ != "") set .@target_id, getcharid(3, @argv$[1]); - if (.@t$ != "" && !(isloggedin(.@target_id))) goto L_Failed; // do NOT fallback to self - - @target_id = .@target_id; - set @remotecmd[2], 0; // only one target - addtimer 0, strnpcinfo(0) + "::OnPC"; - end; - -L_Map: - set @remotecmd[1], 0; // do not include self - goto L_AllMap; - -L_AllMap: - foreach 0, getmapname(), 0, 0, 32767, 32767, strnpcinfo(0)+"::OnPC"; - goto L_Success; - -L_Area: - set @remotecmd[1], 0; // do not include self - goto L_AllMap; - -L_AllArea: - foreach 0, getmapname(), (POS_X - .range), (POS_Y - .range), (POS_X + .range), (POS_Y + .range), strnpcinfo(0)+"::OnPC"; - goto L_Success; - -OnPC: - if (@target_id == BL_ID && @remotecmd[1] < 1) - end; - remotecmd @argv$[0], strcharinfo(0, @target_id); - @remotecmd[0] = @remotecmd[0] + 1; - if (@remotecmd[2] < 1) - goto L_Success; - end; - -L_Success: - gmlog "@remotecmd " + @args$; - message strcharinfo(0), "remotecmd : The operation succeeded. ["+ @remotecmd[0] + "]"; - end; - -L_Failed: - message strcharinfo(0), "remotecmd : Impossible to attach to the target player. Did you try putting the name in \"quotation marks\"?"; - end; - -L_GM: - message strcharinfo(0), "remotecmd : GM command is level "+ CMD_REMOTECMD +", but you are level " + GM; - end; - -OnInit: - set .range, 14; // visible range - registercmd chr(ATCMD_SYMBOL) + "remotecmd", strnpcinfo(0); - end; -} |