News Viewer v1.0.3
Keep your players updated with this easy to use plugin.
Write your news in news.ini & the plugin will add the title to a menu
& display an MOTD with the article if chosen.
- Info messages
- Supports HTML formatting
- Only 1 file for all your news
- Background / font color cvars
- Style in news.ini will be taken over in the MOTD
- Read / Unread tags in titles menu
- Add news in-game using amx_addnews command
news_bgcolor #292421 "Default MOTD Background color"
news_fontcolor #BFBFBF "Default MOTD Font color"
news_advertdelay 400.0 "Time before showing news message again.
* Background & font colors can be set per MOTD using HTML formatting.
* I found these colors here.
Google will help to find a color scheme creator or something if neccesary.
Add your news title with a * in front.
Write your article
You'll need the sqlvault.inc & sqlvault_ex.inc includes from here
& you'll have to compile locally with custom includes
- amx_addnews "Title" "Article"
RCON flag needed for this command.
Article will be at the top of both the menu & news.ini file.
You can use </br> with the command to break the current line & continue on a new one.
- say /news
Displays news menu.
news bla <h1>something</h1>
<font size="7">Boom Headshot</font>
Some more news here
will result in this (v1.0.0 screenshots):
Read / Unread news:
v1.0.0: Created plugin
v1.0.1: Changed Motd_Limit to 1536 (ConnorMcLeod)
Added read/unread articles
Added amx_addnews command.
Added red/yellow menu text for unread/read messages.
v1.0.2: Optimized code & file handling.
v1.0.3: Small optimisations
To do list:
nikhilgupta345: Reviewing my code & helped improving saving system alot & some other things.
All the people that made suggestions / optimisation tips.
Optional : Make me happy and use the ML system.
Optional : You could cache easily the cvars using Cvar Utilities.
- To enable Colorchat, uncomment #define COLORCHAT
on line 4 (Requires to compile locally)
- To change the "News" prefix, change new const g_szPrefix = "News";
on line 5
- If a news article is over the 1536 character limit, it will be skipped & written in the server logs.
- Both includes from here
are needed to compile.
- Compiling must be done locally. For more info, check this
- Since version 1.0.2, articles need to be written on the bottom of the file to be first in the menu.