搜索
查看: 6304|回复: 19

client_exec.amxx 的使用方法,我搞定啦!!

[复制链接]
发表于 2005-3-22 14:13:13 | 显示全部楼层 |阅读模式 来自 山东烟台
client_exec.amxx                ;管理员让指定玩家执行指定的命令
这个插件该怎么使用?知道的指点一下!!谢谢!
发表于 2005-3-22 14:57:34 | 显示全部楼层 来自 河南三门峡
控制台 amx_xclient
回复

使用道具 举报

 楼主| 发表于 2005-3-22 19:27:05 | 显示全部楼层 来自 山东济南
wzf828大虾, 多谢你回复!
我找到你说的命令了amx_xclient,我在控制台输入后没反应啊!
amx_nick倒是可以改客户端玩家的ID。
既然插件可以让客户端执行你的命令,可以让他说你想说的话吗?呵呵。。
amx_xclient这个命令到底该怎么用啊?给我举个例子吧。。。
例如,让玩家编号为#1的说:"wo shi zhu a "该怎么输入?  :)
回复

使用道具 举报

发表于 2005-3-22 22:05:53 | 显示全部楼层 来自 江苏常州
amx_xclient #1 say \'wo shi zhu a\'
回复

使用道具 举报

 楼主| 发表于 2005-3-23 09:13:03 | 显示全部楼层 来自 山西太原
cz222kickbb
你的方法没用!!!
回复

使用道具 举报

 楼主| 发表于 2005-3-24 09:33:49 | 显示全部楼层 来自 台湾
到底怎么用,试了一晚上了!救命!!!!!
回复

使用道具 举报

发表于 2005-3-24 18:42:23 | 显示全部楼层 来自 江苏常州
管方网站说明:
* amx_clexec @CT disconnect
* amx_clexec @TERRORIST "say we will lose!!!"
* amx_clexec #213 "name \'die another day\'"
回复

使用道具 举报

 楼主| 发表于 2005-3-25 15:43:16 | 显示全部楼层 来自 广东广州
首先感谢你的回帖!!
但是amx_clexec 我也试了,没有此命令。。。
amx_xclient 输入后如石沉大海,没有任何反应?
这个插件有人用成功过吗?我是无奈了

官方上的是amx_clexec .amx,现在是amx_clexec.amxx喽!!
回复

使用道具 举报

 楼主| 发表于 2005-3-25 17:55:59 | 显示全部楼层 来自 黑龙江佳木斯
我弄懂了!!
大家看,这是ammx娱乐版中带的client_exec.amxx 源码:
/*
*
* COMMANDS:
* - amx_xclient //run console command on client
*
* *For name for example if the name is DynAstY you can type in console "amx_xclient Dy" and it will do the trick as long as there are not two names starting with Dy.
*
*/


#include <amxmodx>
#include <amxmisc>

public plugin_init() {
        register_plugin("ExecClient", "0.3", "DynAstY")
        register_concmd("amx_xclient", "run_xclient", ADMIN_KICK, "<authid, nick or #userid>")
        return PLUGIN_CONTINUE
}

public run_xclient(id, level, cid) {
        if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED

        new name[32]
        new cmd[128]
        read_argv(1, name, 32)
        read_args(cmd, 128)
       
        new i=0;
        while(cmd==' ') i++
        i+=strlen(name)
        while(cmd==' ') i++
        if (cmd=='"') i++;
        if (cmd[strlen(cmd)-1]=='"') cmd[strlen(cmd)-1]=' ';

        if (equal(name,"*")) {
                client_cmd(0,"%s",cmd)
                client_print(id,print_console,"Executed command on all: %s", cmd)
                return PLUGIN_HANDLED
        }

        new player=find_player("b",name)
        if (player) {
                new playername[32]
                get_user_name(player,playername,31);
                client_cmd(player, "%s", cmd);
                client_print(id,print_console,"Executing command on %s: %s", playername, cmd)
                return PLUGIN_HANDLED
        }
        return PLUGIN_HANDLED
}


原来那些命令都没有定义!!run_xclient是新定义的命令!!!!!!把我害惨了 :dribble:  :dribble:
回复

使用道具 举报

 楼主| 发表于 2005-3-25 17:59:58 | 显示全部楼层 来自 黑龙江佳木斯
我也找到了原来这个amx_clexec .amx的源码,即与官方的说明相对应的:
/* AMX Mod script.
*
* (c) Copyright 2002-2003, OLO
* This file is provided as is (no warranties).
*
* Usage: amx_clexec <authid, nick, @team or #userid> <command line>
* Examples:
* amx_clexec @CT disconnect
* amx_clexec @TERRORIST "say we will lose!!!"
* amx_clexec #213 "name \'die another day\'"
*
*/

#include <amxmod>
#include <amxmisc>

public plugin_init()
{
register_plugin("Admin Clexec","0.9.4","default")
register_concmd("amx_clexec","admin_clexec",ADMIN_LEVEL_A,"<authid, nick, @team or #userid> <command line>")
}

clexec_player(id,victim,cmdline[]){
new name[32]
get_user_name(victim,name,31)
if (is_user_bot(victim)){
new cmd[32]
parse(cmdline,cmd,31)
engclient_cmd(victim,cmd,cmdline[strlen(cmd)+1])
}
else
client_cmd(victim,cmdline)
console_print(id,"Command line ^"%s^" has been executed on ^"%s^"",cmdline,name)
}

public admin_clexec(id,level,cid) {
if (!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED
new arg[32], cmdline[64]
read_argv(1,arg,31)
read_argv(2,cmdline,63)
while ( replace( cmdline ,63,"\'","^"") ) { }
if (arg[0]=='@'){
new players[32], inum , name[32]
get_players(players,inum,"e",arg[1])
if (inum==0){
console_print(id,"No clients in such team")
return PLUGIN_HANDLED
}
for(new a=0;a<inum;++a){
if (get_user_flags(players[a])&ADMIN_IMMUNITY){
get_user_name(players[a],name,31)
console_print(id,"Skipping ^"%s^" because client has immunity",name)
continue
}
clexec_player(id,players[a],cmdline)
}
}
else {
new player = cmd_target(id,arg,1)
if (!player) return PLUGIN_HANDLED
clexec_player(id,player,cmdline)
}
return PLUGIN_HANDLED
}

这下终于明白原因了!!!! :d:  :d:  :d:
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表