|
发表于 2006-5-3 23:53:54
|
显示全部楼层
来自 中国–广东–深圳–南山区
回复: 【问题】怎么关掉服务器的RCON 命令???
有个插件可以指定关掉部分rcon的指令。
给你一段源码,编译后就可以用了。
*/
#include <amxmodx>
#include <amxmisc>
public amx_commands(id,level,cid) {
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
if (read_argc() > 1) {
new command[32], variable[32]
read_argv(0,command,31)
read_argv(1,variable,31)
set_cvar_string(command,variable)
console_print(id,"^"%s^" has been set to ^"%s^"",command,variable)
return PLUGIN_HANDLED
}
new command[32], variable[32]
read_argv(0,command,31)
get_cvar_string(command,variable,31)
console_print(id,"^"%s^" is set to ^"%s^"",command,variable)
return PLUGIN_CONTINUE
}
public amx_exec(id,level,cid) {
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new cfg[32]
read_argv(1,cfg,31)
server_cmd("exec ",cfg)
return PLUGIN_HANDLED
}
public plugin_init(){
register_plugin("No Rcon","0.1","ToXIC")
register_clcmd("sv_restart","amx_commands",ADMIN_LEVEL_A,"<#seconds>")
register_clcmd("sv_restartround","amx_commands",ADMIN_LEVEL_A,"<#seconds>")
register_clcmd("sv_alltalk","amx_commands",ADMIN_LEVEL_A,"<1-on/0-off>")
register_clcmd("sv_gravity","amx_commands",ADMIN_LEVEL_A,"<#> (default=800)")
register_clcmd("mp_timelimit","amx_commands",ADMIN_LEVEL_A,"<#minutes>")
register_clcmd("mp_roundtime","amx_commands",ADMIN_LEVEL_A,"<#minutes>")
register_clcmd("mp_buytime","amx_commands",ADMIN_LEVEL_A,"<#minutes> (for seconds use .5 etc.)")
register_clcmd("mp_freezetime","amx_commands",ADMIN_LEVEL_A,"<#seconds>")
register_clcmd("mp_c4timer","amx_commands",ADMIN_LEVEL_A,"<#seconds> - CS Command")
register_clcmd("mp_maxrounds","amx_commands",ADMIN_LEVEL_A,"<#rounds>")
register_clcmd("mp_forcecamera","amx_commands",ADMIN_LEVEL_A,"<2-team only/1-any player/0-off>")
register_clcmd("mp_forcechasecam","amx_commands",ADMIN_LEVEL_A,"<2-team only/1-any player/0-off>")
register_clcmd("mp_fadetoblack","amx_commands",ADMIN_LEVEL_A,"<1-on/0-off> - CS Command")
register_clcmd("mp_friendlyfire","amx_commands",ADMIN_LEVEL_A,"<1-on/0-off>")
register_clcmd("mp_limitteams","amx_commands",ADMIN_LEVEL_A,"<# of players 1 team can have over the other/0-off>")
register_clcmd("mp_tkpunish","amx_commands",ADMIN_LEVEL_A,"<1-on/0-off>")
register_clcmd("mp_hostagepenalty","amx_commands",ADMIN_LEVEL_A,"<# of hostages killed before kicking player/0-off> - CS Command")
register_clcmd("hostname","amx_commands",ADMIN_LEVEL_A,"<changes server name>")
register_clcmd("allow_spectators","amx_commands",ADMIN_LEVEL_A,"<# of specators to allow>")
register_clcmd("exec","amx_exec",ADMIN_LEVEL_A,"<execute cfg>")
return PLUGIN_CONTINUE
} |
|