Raised This Month: $105 Target: $400
 26% 

Advanced Motd 1.2 (updated)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:          Approver:   v3x (159)
kinsprite2
Junior Member
Join Date: Mar 2006
Old 03-23-2006 , 01:29   Advanced Motd 1.2 (updated)
Reply With Quote #1

Code:
/* 
	   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.
*/
Code:
#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[MAX_MOTD_SUPPORT][1200] new motd_header[MAX_MOTD_SUPPORT][32] new max_motd new bool:motd_showed[33] = false new round_counter new showmotd_counter[33] 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 }
Attached Files
File Type: sma Get Plugin or Get Source (advancedmotd.sma - 2815 views - 5.5 KB)
kinsprite2 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-23-2006 , 01:41  
Reply With Quote #2

Do not hardcode paths:
Code:
if(file_exists("addons/amxmodx/configs/motd_header.cfg"))
Use get_configsdir() and format().
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
kinsprite2
Junior Member
Join Date: Mar 2006
Old 03-23-2006 , 08:46  
Reply With Quote #3

Quote:
Originally Posted by v3x
Do not hardcode paths:
Code:
if(file_exists("addons/amxmodx/configs/motd_header.cfg"))
Use get_configsdir() and format().
fixed it and changed some others.
kinsprite2 is offline
adigh
Junior Member
Join Date: Nov 2005
Old 12-22-2006 , 18:03   Re: Advanced Motd 1.2 (updated)
Reply With Quote #4

it is great, but I wonder if it can make transparent background. :-) Then will be super great.
adigh is offline
SCHWEDEN
Member
Join Date: Dec 2007
Location: 127.0.0.1
Old 03-15-2008 , 22:13   Re: Advanced Motd 1.2 (updated)
Reply With Quote #5

When i put this code in motd, it doesnt work:

Code:
 <HTML> <frameset cols="*" framespacing="0" frameborder="no" border="0">
<frame src="YOURHTTPMOTD.HTMLHERE" name="frame_main" /> </frameset> </HTML>
It only shows a white blank page with some strange symbols on it (like wingdings) if i try for example http://www.google.com as an url.

Any idea why?
__________________

SCHWEDEN is offline
Send a message via MSN to SCHWEDEN
nunoabc
Senior Member
Join Date: Aug 2007
Location: Portugal, VN Gaia
Old 07-16-2008 , 17:31   Re: Advanced Motd 1.2 (updated)
Reply With Quote #6

You have got to host the HTML page in a Web server and put its path. Try this code in your MOTD (yours has errors ):
HTML Code:
<html>
<frameset cols="*">
    <frame src="http://www.domain.com/motd.html" name="frame_main" frameborder="0">
</frameset>
</html>
If you put in the frame source "motd.html", your MOTD will think that there is a page called motd.html on the client side (don't ask me why).

If you want to, I can host your HTML page... (If it is one page only)
__________________
nunoabc is offline
gunnersslash
Member
Join Date: Mar 2009
Old 01-21-2010 , 00:18   Re: Advanced Motd 1.2 (updated)
Reply With Quote #7

maybe thread is too old but anyway xD


1. i've made a lot of motd.amxx plugin whit their respective .cfg file ie:

motd-hns.amxx and motd-hns.cfg
motd-deathrun.amxx and motd-deathrun.cfg
motd-surf.amxx and motd-surf.cfg

and each motd it's supossed to be loaded when the plugin is loaded too (multimod)


but when i enter into the server i've seen that the (i.e) motd-hns shows motds randomly each 5 rounds

what is wrong?
gunnersslash is offline
Nibs
Member
Join Date: Apr 2009
Old 01-25-2010 , 18:53   Re: Advanced Motd 1.2 (updated)
Reply With Quote #8

Just use <iframe></iframe> codes
Nibs is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:27.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode