|
[PHP]////////////////////////////////
//edit by Cr@zyTreE 2008.05.14
///////////////////////////////
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "Automatic sXe Downloader"
#define VERSION "1.1"
#define AUTHOR "Kimi"
#define MSG_DELAY 6.0
#define MAX_CLIENTS 32
new bool:g_bFirst_connect[ MAX_CLIENTS + 1 ];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /sxe","_show_sxe");
register_event("ResetHUD","eHud_reset","be");
}
public _show_sxe(id)
{
new sXe_url[256]
new sXe_version[64]
get_cvar_string("__sxei_clt_ver",sXe_version,63)
new usrname[33]
get_user_name ( id, usrname, 32)
if(equal(usrname,"[NO-sXe-I]",10)) {
[color="red"]format(sXe_url,255,"http://ftp.cgv.se/sxe/sXeInjectedClient%s.rar",sXe_version)
}
else format(sXe_url,255,"<head><META http-equiv=Content-Type content='text/html ;charset=UTF-8'></head><body bgcolor=black><center><font size=4 color=red>您已安装并使用与服务器相对应的sXe版本,无需下载</font>")
show_motd(id,sXe_url,"sXe客户端下载");
return 1;
}
public client_putinserver(id) g_bFirst_connect[id] = true;
//public client_disconnect (id) g_bFirst_connect[id] = false;
public eHud_reset(id)
{
if( !g_bFirst_connect[id] )
return;
//g_bFirst_connect[id] = true;
set_task( MSG_DELAY,"PrintDelayed",id);
}
public PrintDelayed(id)
{
new usrname[33]
get_user_name ( id, usrname, 32)
if(equal(usrname,"[NO-sXe-I]",10))
client_print(id,print_chat," 【提示】未安装sXe,请按 Y 输入/sxe下载sXe"); [/PHP]
主要修改的是:
if(equal(usrname,"[NO-sXe-I]",10)) {
[color="red"]format(sXe_url,255,"http://ftp.cgv.se/sxe/sXeInjectedClient%s.rar",sXe_version)[/color]
这个是SXE下载插件,目前有两个问题,请各位大侠帮下我!
当有用下载的时候,可以正常弹出下载,但返回游戏的时候,又再一次下载,无限次的下载.只到你关掉MOTD窗口!(但很难关闭MOTD窗口,总被弹出来!)
想法:有可用下载的时候,弹出下载窗口,在MOTD显示"已经下载",不再第二次连续弹出下载窗口!
其次,当没有可用的下载时!MOTD显示没有找到可用下载!
麻烦各位了!:burn: |
|