zwfgdlc 发表于 2007-12-8 16:08:25

回复: 版主进来看一下~帮忙~

改这样试下.

#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,num
get_players(players,num)
new opcount,msg
for(new i=0;i<num;i++)
{
new id=players
if(get_user_flags(id)&ADMIN_IMMUNITY)
{
   opcount++
   new opname
   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,"^x04当前没有在线OP")
}
else
{
new opmsg
format(opmsg,127,"^x04当前在线OP共%d名,%s",opcount,msg)
client_color(0,players,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()
}
页: 1 [2]
查看完整版本: 版主进来看一下~帮忙~