Raised This Month: $51 Target: $400
 12% 

Dynamic MOTD v1.1


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Statistical       
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-11-2006 , 18:12   Dynamic MOTD v1.1
Reply With Quote #1

Description:

Ever wanted a motd that wasn't completely retarded, like the one built in to counterstrike? What this plugin does is modify the motd file such that it contains a welcome message as well as the number of clients that have visited the server to date. It doesn't have to be like this though - you can use your old MOTD. It simply replaces a select few tags with numbers to give your MOTD more freedom without javascript and other crazy stuff that the Steam browsers don't support. It saves into a file in your data directory called "visits.ini", so you can also see how many connects your server has had.

-------------------------------------------------------------------

Required stuff:

- A mod that supports HTML MOTDs. If you know how to code HTML, you can easily change this so it only contains text, and the plugin will still work.

-------------------------------------------------------------------

Installation:

Install like any other plugin.

After this is installed, it should create a file called "motd_dynamic.txt" in your $moddir (if playing counterstrike, it's cstrike, day of defeat = dod, Team Fortress Classic = tfc, etc)

Edit this file to suit your motd. Add in the tag "<uptime>" and "<visits>" and this plugin will dynamically replace those tags with their respective numbers.

If you don't know HTML, then just use the default MOTD that comes with it.

-------------------------------------------------------------------

Notes:

- To modify the background color, open up the plugin, find #define BGCOLOR, and change it to whatever. How to change it: #rrggbb (red green blue)

- This is designed for people who do not know how to code in Javascript, PHP, or any language, but wish you have a semidecent MOTD with these abilities.
Attached Files
File Type: sma Get Plugin or Get Source (dynamic_motd.sma - 4516 views - 4.9 KB)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Old 01-11-2006, 18:49
Sonic7145
This message has been deleted by Sonic7145.
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 01-11-2006 , 18:54  
Reply With Quote #2

I have code that reads through motd files and puts what you want in there. It was in my Master Vote plugin. Only thing is there is a character limit on it.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-11-2006 , 18:55  
Reply With Quote #3

Quote:
Originally Posted by Suicid3
I have code that reads through motd files and puts what you want in there. It was in my Master Vote plugin. Only thing is there is a character limit on it.
So... does that mean this is redundant?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 01-11-2006 , 18:57  
Reply With Quote #4

No, means you can use that code so you dont have to think of a way to do it....my master vote is completely different it just uses a dynamic motd.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-11-2006 , 18:58  
Reply With Quote #5

Quote:
Originally Posted by Suicid3
No, means you can use that code so you dont have to think of a way to do it....my master vote is completely different it just uses a dynamic motd.
I'm not incapable

I just haven't had much time lately, and thought I would release this anyway. It's no where near done yet.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 01-12-2006 , 12:40  
Reply With Quote #6

I think #pragma dynamic 32768 can extend a motd's size, so if you wanted to add other stuff in it.
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 01-12-2006 , 14:04  
Reply With Quote #7

Quote:
Originally Posted by Charr
I think #pragma dynamic 32768 can extend a motd's size, so if you wanted to add other stuff in it.
Thats not what I was talking about. I was saying in the code its
Code:
new szMotd[MAX_HERE]
as the char limit.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 01-12-2006 , 14:54  
Reply With Quote #8

Now I get it
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
Curryking
Veteran Member
Join Date: Jun 2004
Location: 51.22°N / 6.77°E
Old 01-12-2006 , 15:15  
Reply With Quote #9

Quote:
Originally Posted by Curry via PN
Hey Hawk552,

I love your idea of announcing how many players have visited the server, but I like to have this placed as HUD when someone connects, something like "Welcome %player% to %server%
you are visitor %number% today!"

Is something like this doable? I've only found the following plugin, but unfortunatly I have no idea how to merge it with yours (even if this could be done)

Could you help me out or should I start a new thread in "Suggestions / Requests?"

Whatever, thanks in advance!

Cheers,
Curry

Code:
 /* * * Welcome HudMsg *  by JustinHoMi * */ #include <amxmodx> public client_putinserver(id) {     new ids[1]     ids[0] = id     set_task(10.0,"welcome_msg",0,ids,1)     return PLUGIN_CONTINUE } public welcome_msg(ids[]){     new motm[192],hostname[64],name[32],id = ids[0]     get_cvar_string("amx_welcome_hudmsg",motm,191)     get_cvar_string("hostname",hostname,63)     replace(motm,191,"%hostname%",hostname)     get_user_name(id,name,31)     replace(motm,191,"%name%",name)     set_hudmessage(0,225,0)     show_hudmessage(id,motm)     return PLUGIN_CONTINUE } public plugin_init() {     register_plugin("Welcome HudMsg","0.3","JustinHoMi")     register_cvar("amx_welcome_hudmsg","Welcome %name% to %hostname%")     return PLUGIN_CONTINUE }
;-)
__________________
Full speed - no brakes!
Curryking is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-12-2006 , 15:45  
Reply With Quote #10

Will be merged in next release.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply



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 18:23.


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