Raised This Month: $32 Target: $400
 8% 

News Viewer v1.0.3


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Server Management        Approver:   Arkshine (91)
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-09-2011 , 10:17   News Viewer v1.0.3
Reply With Quote #1

News Viewer v1.0.3


Description:
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.


Features:
- 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


Cvars:
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.


Usage:
Create amxmodx/configs/news.ini.
Add your news title with a * in front.
Write your article


Requirements:
You'll need the sqlvault.inc & sqlvault_ex.inc includes from here
& you'll have to compile locally with custom includes.


Commands:
- 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.


Example:
Code:
* Title
news bla <h1>something</h1> 
<u>HACKS</u>
<b>Aimbot</b>
<font size="7">Boom Headshot</font>

* BLA
Some more news here
will result in this (v1.0.0 screenshots):







(v1.0.1 Screenshots)
Read / Unread news:



Changelog:
Code:
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
Credits:
Code:
nikhilgupta345: Reviewing my code & helped improving saving system alot & some other things.

All the people that made suggestions / optimisation tips.
To do list:
Optional : Make me happy and use the ML system.
Optional : You could cache easily the cvars using Cvar Utilities.


Notes:
- 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 tutorial.
- Since version 1.0.2, articles need to be written on the bottom of the file to be first in the menu.
Attached Files
File Type: zip old_versions.zip (8.1 KB, 458 views)
File Type: sma Get Plugin or Get Source (news_103.sma - 1627 views - 8.4 KB)
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 11-01-2011 at 14:29.
drekes is offline
Send a message via MSN to drekes
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-09-2011 , 10:19   Re: News Viewer 1.0.0
Reply With Quote #2

Good job
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-09-2011 , 10:30   Re: News Viewer 1.0.0
Reply With Quote #3

why bg/font color can't be defined per motd ?
__________________
Arkshine is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-09-2011 , 10:33   Re: News Viewer 1.0.0
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
why bg/font color can't be defined per motd ?
It can be if it's formatted with HTLM in the article itself.
The cvar are the default colors.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
jackas
Senior Member
Join Date: Feb 2011
Old 10-09-2011 , 10:34   Re: News Viewer 1.0.0
Reply With Quote #5

looks cool m gonna try it asap....
jackas is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-09-2011 , 10:37   Re: News Viewer 1.0.0
Reply With Quote #6

So, can a player read all news he missed ??
Think of it ;)

Would be usefull to be able to write the new from the game.

FYI, max motd length is 1536.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-09-2011 at 10:41.
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-09-2011 , 10:40   Re: News Viewer 1.0.0
Reply With Quote #7

Quote:
Originally Posted by drekes View Post
It can be if it's formatted with HTLM in the article itself.
The cvar are the default colors.
You're right, not thought of that. But that's something you should clearly say because not obvious at first.
__________________
Arkshine is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-09-2011 , 11:02   Re: News Viewer 1.0.0
Reply With Quote #8

Suggestion: Add to the menu when a player opens it [Unread] or [Read]

or like

[New]
[Old]
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-09-2011 , 11:14   Re: News Viewer 1.0.0
Reply With Quote #9

Updated description with to-do list & better color cvar info.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
cFG
SourceMod Donor
Join Date: Aug 2009
Location: Poland, Łódź
Old 10-09-2011 , 14:51   Re: News Viewer 1.0.0
Reply With Quote #10

sql addition would be awesome
__________________
HLXBans - worthy successor of AMXBans
cFG is offline
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 16:49.


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