|
发表于 2007-12-8 16:08:25
|
显示全部楼层
来自 中国–广东–惠州
回复: 版主进来看一下~帮忙~
改这样试下.
[php]
#include <amxmodx>
#include <amxmisc>
#define PLUGIN_NAME "show onlne OP"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "zwfgdlc"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
set_task(60.0,"showOP",_,_,_,"b") //60.0 表示60秒显示一次,自己修改自己需要的显示时间
}
public showOP()
{
new players[32],num
get_players(players,num)
new opcount,msg[512]
for(new i=0;i<num;i++)
{
new id=players
if(get_user_flags(id)&ADMIN_IMMUNITY)
{
opcount++
new opname[32]
get_user_name(id,opname,31)
if(containi(msg,opname)!=-1)
continue
else
format(msg,511,"%s ^x03%s",msg,opname)
}
}
if(opcount==0)
{
client_color(0,players[1],"^x04当前没有在线OP")
}
else
{
new opmsg[128]
format(opmsg,127,"^x04当前在线OP共%d名,%s",opcount,msg)
client_color(0,players[1],opmsg)
}
}
public client_color(playerid, colorid, msg[])
{
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),{0,0,0},playerid)
write_byte(colorid)
write_string(msg)
message_end()
}
[/php] |
|