client_exec.amxx 的使用方法,我搞定啦!!
client_exec.amxx ;管理员让指定玩家执行指定的命令这个插件该怎么使用?知道的指点一下!!谢谢! 控制台 amx_xclient wzf828大虾, 多谢你回复!
我找到你说的命令了amx_xclient,我在控制台输入后没反应啊!
amx_nick倒是可以改客户端玩家的ID。
既然插件可以让客户端执行你的命令,可以让他说你想说的话吗?呵呵。。
amx_xclient这个命令到底该怎么用啊?给我举个例子吧。。。
例如,让玩家编号为#1的说:"wo shi zhu a "该怎么输入?:) amx_xclient #1 say \'wo shi zhu a\' cz222kickbb
你的方法没用!!! 到底怎么用,试了一晚上了!救命!!!!! 管方网站说明:
* amx_clexec @CT disconnect
* amx_clexec @TERRORIST "say we will lose!!!"
* amx_clexec #213 "name \'die another day\'" 首先感谢你的回帖!!
但是amx_clexec 我也试了,没有此命令。。。
amx_xclient 输入后如石沉大海,没有任何反应?
这个插件有人用成功过吗?我是无奈了
官方上的是amx_clexec .amx,现在是amx_clexec.amxx喽!! 我弄懂了!!
大家看,这是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
new cmd
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=='"') cmd=' ';
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
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: 我也找到了原来这个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
get_user_name(victim,name,31)
if (is_user_bot(victim)){
new cmd
parse(cmdline,cmd,31)
engclient_cmd(victim,cmd,cmdline)
}
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, cmdline
read_argv(1,arg,31)
read_argv(2,cmdline,63)
while ( replace( cmdline ,63,"\'","^"") ) { }
if (arg=='@'){
new players, inum , name
get_players(players,inum,"e",arg)
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)&ADMIN_IMMUNITY){
get_user_name(players,name,31)
console_print(id,"Skipping ^"%s^" because client has immunity",name)
continue
}
clexec_player(id,players,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:
页:
[1]
2