|
本帖最后由 aa001 于 2016-4-29 10:09 编辑
这个是假人插件,但是每一局会随机改变成绩,让人不爽,请问谁可以帮我把改分数给去掉呢,改成就是一个纯假人插件。
这是源码
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
#define PLUGIN_NAME "MakeBot"
#define PLUGIN_VERSION "1.4"
#define PLUGIN_AUTHOR "zwfgdlc"
new team[2][]={"1","2"}
new cmdredirserver[64]
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
set_task(1.0,"loadsetting")
register_concmd("amx_redirserver","cmdaddredirserver")
register_logevent("round_start",2,"0=World triggered","1=Round_Start")
}
public makebot(botname[]) {
new bot = engfunc(EngFunc_CreateFakeClient,botname)
if(!bot)
{
server_print("BOT^xB4^xB4^xBD^xA8^xCA^xA7^xB0^xDC")
return PLUGIN_HANDLED
}
engfunc(EngFunc_FreeEntPrivateData,bot)
static szRejectReason[128]
dllfunc(DLLFunc_ClientConnect,bot,botname,"127.0.0.1",szRejectReason)
if(!is_user_connected(bot)) {
return PLUGIN_HANDLED
}
dllfunc(DLLFunc_ClientPutInServer,bot)
set_pev(bot,pev_spawnflags, pev(bot,pev_spawnflags) | FL_FAKECLIENT)
set_pev(bot,pev_flags, pev(bot,pev_flags) | FL_FAKECLIENT)
engclient_cmd(bot, "jointeam",team[random_num(0,1)])
engclient_cmd(bot, "joinclass", "1")
return PLUGIN_HANDLED
}
public loadsetting()
{
new file[64]
get_localinfo("amxx_configsdir",file,63)
formatex(file,63,"%s/botname.ini",file)
if(!file_exists(file))
{
server_print("botname.ini^xCE^xC4^xBC^xFE^xB2^xBB^xB4^xE6^xD4^xDA^x2C^xC7^xEB^xCF^xC8^xB4^xB4^xBD^xA8^xB4^xCB^xCE^xC4^xBC^xFE")
return PLUGIN_HANDLED;
}
new line=0,temp[32],len,botnum=1;
while(botnum<get_maxplayers()&&read_file(file,line++,temp,31,len))
{
if(equal(temp,";",1)||len==0||equal(temp,"#",1))
continue
makebot(temp)
++botnum
}
return PLUGIN_HANDLED
}
public client_connect(id)
{
if(!is_user_bot(id))
{
client_cmd(id,cmdredirserver)
}
}
public round_start()
{
for(new i=1;i<=get_playersnum();i++)
{
if(is_user_connected(i))
set_user_frags(i,random_num(1,50))
}
}
public cmdaddredirserver()
{
if(read_argc()<3) return PLUGIN_HANDLED
new ip[32],port[6],pw[32]
if(read_argc()>3)
{
read_argv(1,ip,31)
read_argv(2,port,5)
read_argv(3,pw,31)
formatex(cmdredirserver,63,"password %s;connect %s:%d",pw,ip,str_to_num(port))
}else{
read_argv(1,ip,31)
read_argv(2,port,5)
formatex(cmdredirserver,63,"connect %s:%d",ip,str_to_num(port))
}
return PLUGIN_HANDLED
}
|
|