【发布】Advanced Motd 1.2 (已通过官方核准的)
(以下为英文做的翻译)使用该插件,你可以向玩家显示广告或者规则!
*** 主目录是AMXX配置文件所在的目录 ***
(MOTD就是进入游戏时看到的那个页面;amxx能在游戏中显示同样的页面,这些页面的内容你可以自定义。)
默认的MOTDs目录为 "addons/amxmodx/configs/motd"
你可以通过 #define MOTD_FOLDER 来改变该路径。本插件读取该目录寻找MOTD文件。最多支持 MAX_MOTD_SUPPORT(默认为5) 个MOTD文件。如果想改变该值,只需 #define MAX_MOTD_SUPPORT 到另一个数字。在每个Motd文件中,只有前1200个字(不是汉字-双字)有效。(不包括 0,即新的一行)
默认Motd标题配置文件是“addons/amxmodx/configs/motd_header.cfg”。当然,你可以通过 #define MOTD_HEADER_CONFIG 为另一个字符串来改变它. 添加Advanced Motd 的标题到该文件。从第二行开始,每行一个标题 (一个标题最多容纳24个字节左右)。如果一个motd没有标题,将使用服务器名称代替。
在VGUI2(CS1.6就是使用这个,1.5的不是)中,MOTD文件可以使用 HTML 语言编辑
CVARS:(参数)
amx_advancedmotd 默认为 1; 想不给玩家显示motd,将它设置为0
amx_showmotdeveryrounds 默认为 5; 设置每多少局给玩家死后显示一张motd.
/*
With this plugin, you can show some advertisement or rules to the players.
*** The main folder is AMXX configs DIR ***
Default Motds dir is "addons/amxmodx/configs/motd";
you can change it by #define MOTD_FOLDER to other string
The plugin will read the dir for Motds
Max support for MAX_MOTD_SUPPORT (default 5) motd files.
If you want to change this,just #define MAX_MOTD_SUPPORT to another number.
In each Motd,only the first 1,200 characters are effective,(not include '0' - newline)
Default Motd Header config file is "addons/amxmodx/configs/motd_header.cfg"
Also, you can change it by #define MOTD_HEADER_CONFIG to other string.
Add Advanced Motd's headers to this file. Form the second line,one line one title!
If a motd has no header,will use the server name instead.
Motd files can be HTML formatted with VGUI2.
A Motd will showed when a player dies every <five or ...> rounds.
v1.2 changed Log:
fixed a bug when reloadmotd.(last time,forgot to reset max_motd zero,^_^)
v1.1 changed Log:
change MOTD folder dir
can define MOTD_FOLDER and MOTD_HEADER_CONFIG
load MOTD files and config file using file handle
fixed bugs in read file content function
Cvars:
amx_advancedmotd ,default 1; disable to show motd to the players,set it to 0
amx_showmotdeveryrounds ,default 5; Set how many rounds to show one motd when dying.
*/
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Advanced Motd"
#define VERSION "1.2"
#define AUTHOR "KinSprite"
#define MAX_MOTD_SUPPORT 5
#define MOTD_FOLDER "motd"
#define MOTD_HEADER_CONFIG "motd_header.cfg"
new g_advancedmotd
new g_showmotdeveryrounds
new motd
new motd_header
new max_motd
new bool:motd_showed = false
new round_counter
new showmotd_counter
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_reloadmotd","cmd_reloadmotd",ADMIN_IMMUNITY," - reload Advanced Motd")
g_advancedmotd = register_cvar("amx_advancedmotd","1")
g_showmotdeveryrounds = register_cvar("amx_showmotdeveryrounds","5")
set_task(1.2,"load_motd")
register_logevent("startnewround",2,"0=World triggered","1=Round_Start")
register_event("DeathMsg", "show_Advmotd","a")
return PLUGIN_CONTINUE
}
只上传*.sma源代码,大家自己编译去。
回复: 【发布】Advanced Motd 1.2 (已通过官方核准的)
:d: 感谢 :cold:回复: 【发布】Advanced Motd 1.2 (已通过官方核准的)
以前有没有人用过~?发表以下意见~回复: 【发布】Advanced Motd 1.2 (已通过官方核准的)
能讲下详细的用法吗???另外我汉化了此插件,将原代码发上来(是帖中的原代码汉化)
不知道为什么不能编译原帖的附件(并没有修改,在AMXX1。60下)
如汉化不周请提出修改建议!
回复: 【发布】Advanced Motd 1.2 (已通过官方核准的)
跟rules插件一个效果?回复: 【发布】Advanced Motd 1.2 (已通过官方核准的)
Post by cityhonghu跟rules插件一个效果?
也许吧,这个也有rules。 反正我的算法已经达到极限了。文件载入全部使用句柄操作,每张Motd只需载入一次(减少每次显示去读取硬盘,影响服务器速度)。别的方面想了解自己看源代码。
回复: 【发布】Advanced Motd 1.2 (已通过官方核准的)
在每个Motd文件中,只有前1200个字(不是汉字-双字)天了~~这插件不支持中问吗???
可以用UTF-8保存MOTD才能显示中文吗????
回复: 【发布】Advanced Motd 1.2 (已通过官方核准的)
不知道干嘛用的 :cool:回复: 【发布】Advanced Motd 1.2 (已通过官方核准的)
Post by knhgcn天了~~这插件不支持中问吗???
可以用UTF-8保存MOTD才能显示中文吗????
MOTD内容要支持中文,使用ASCII编码。MOTD标题使用UTF-8编码。
回复: 【发布】Advanced Motd 1.2 (已通过官方核准的)
MOTD内容要支持中文,使用ASCII编码。MOTD标题使用UTF-8编码。内容不都是同一个MOTD。TXT中吗??怎么可以标题用UTF-8保存呢????
(是指内容标题吗??)
页:
[1]
2