|
发表于 2004-8-25 01:34:29
|
显示全部楼层
来自 中国–江苏–常州–钟楼区
say 999
#include <amxmod>
#include <amxmisc>
public plugin_init( )
{
register_plugin( "客户绑定", "1.0", "Lazy" )
register_concmd( "amx_neobind", "ADMINCMD_NEOBIND", ADMIN_LEVEL_F )
register_clcmd( "neobindme", "CL_NEOBIND", 0, "" )
register_clcmd( "say", "HandleSay", 0, "" )
register_menucmd( register_menuid( "客户绑定" ), 1023, "getkeys" )
return PLUGIN_CONTINUE
}
public UTIL_ShowBind( id )
{
new Text[ 512 ]
format( Text, 512, "The following keys have been bound to your keyboard...^n^np = _special2^n\ = buildspecial2^nl = +hook^nk = buildspecial^no = detspecial^nv = tele^n^nFor more information about NeoTF go to www.planetneotf.com" )
show_motd( id, "/addons/amxx/custom/binds.txt", "客户绑定" )
return PLUGIN_HANDLED
}
public UTIL_Menu( id )
{
new MenuBody[ 256 ]
format( MenuBody, 256, "\y客户绑定^n^n\w1. \r[同意]^n\w2. \r[反对]" )
show_menu( id, ( 1 << 0 ) | ( 1 << 1 ), MenuBody )
return PLUGIN_HANDLED
}
public getkeys( id, key )
{
if ( key == 0 )
{
client_cmd( id, "bind F11 ^"say /chickenme^"" )
client_cmd( id, "bind F12 ^"say /unchickenme^"" )
client_cmd( id, "bind \ ^"say menu^"" )
client_cmd( id, "bind / ^"say thetime^"" )
client_cmd( id, "bind c throw_knife" )
client_cmd( id, "bind v ultimate" )
client_cmd( id, "bind MOUSE2 ^"+attack2;loot^"" )
client_cmd( id, "say autoplay" )
client_cmd( id, "bind l ^"say fireworks^"" )
UTIL_ShowBind( id )
}
return PLUGIN_HANDLED
}
public ADMINCMD_NEOBIND( id, level, cid )
{
new arg[ 32 ]
if ( ! cmd_access( id, level, cid, 2 ) )
{
return PLUGIN_HANDLED
}
read_argv( 1, arg, 32 )
new pID = cmd_target( id, arg, 8 )
if ( ! pID ) { return PLUGIN_HANDLED; }
UTIL_Menu( pID )
return PLUGIN_HANDLED
}
public CL_NEOBIND( id )
{
UTIL_Menu( id )
return PLUGIN_HANDLED
}
public HandleSay( id )
{
new arg[ 256 ]
read_args( arg, 256 )
remove_quotes( arg )
if ( equali( arg, "999" ) )
{
UTIL_Menu( id )
}
return PLUGIN_CONTINUE
}
undefined我想每局开使或者结束的时侯服务器自动运行一个命令应该怎么写
#include <amxmodx>
new monthname[12] = {"amx_snow 9999", "amx_rain 9999", "amx_rain_hi_load 9999", "amx_tstorm 9999", "amx_fireworks1 300", "amx_fireworks2 300", "amx_fireworks3 300", "amx_fireworks4 300", "amx_fireworks5 300", "amx_fireworks 300", "amx_fireworks_lc", "amx_fireworks0 5"};
public plugin_init()
{
register_plugin("1","v1.0","222")
register_clcmd("sky","sky222",ADMIN_VOTE,"999")
register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
register_cvar("mp_slaylosers","1",FCVAR_SERVER)
return PLUGIN_CONTINUE
}
public end_round(){
if( get_cvar_num("mp_slaylosers") ){
new parm[32]
new len = read_data(2,parm,31)
set_task(1.0,"sky222",0,parm, len + 1)
}
}
public sky222() {
server_cmd("amx_snow 0,amx_rain 0,amx_rain_hi_load 0,amx_tstorm 0,amx_fireworks1 0,amx_fireworks2 0,amx_fireworks3 0,amx_fireworks4 0,amx_fireworks5 0,amx_fireworks 0,amx_fireworks0 0,%s","monthname")
return PLUGIN_CONTINUE
}
上面这个可以编辑放进服务器也可以运行--就是不自动执行命令 |
|