Adverts
version 1.0.1
by Wiebbe (with alot of help from Ferrets code)
Description
This plugin is just like the BAT SourceMOD plugin which can show adverts on the server. This plugin will read a ini file with all adverts located on a single line and display them in a linear order. The ads are rotated on a time basis which is set using a Cvar. It also allows to use certain replaceable texts to fill up the ads and make them more dynamic.
Before i receive alot of flaming, i am kinda new to this sort of plugin coding and i used code from other pieces of plugins. The adverts system was not available yet so i decided to use different parts from different coders. I used the "message type" part from the Exclusion chat, i used the variable code from Mapchooser and Nextmap. I dont claim i wrote everything from scratch but it works like a charm for me and i wanted to share it. It can most likely be made a lot better but this works for me!
So credit where credit is due!
Cvars
- sm_adverts_file
- File where the ads are taken from
- Default: configs/adverts.ini
- sm_adverts_time
- Rotation time for the ads
- Default: 300 seconds (5 minutes)
- sm_adverts_enabled
- Disables or Enables the showing of the ads
- Default: Enabled (1)
- sm_adverts_msgtype
- How is the message showed on the server?
- 1: Normal chat - green color
- 2: Hint text
- 3: Center on screen text
- 4: Panel on top
- Default: Normal chat (1)
Requirements
You NEED the adverts.ini, place this in the: "configs/" directory from sourcemod!
Just add a new ad on each time. Each ad can be 192 characters because this is the maximum the chat can be itself. there is a Maximum of 128 ads which i thougt would be enought.
Optional
If you have the nextmap plugin installed the advert plugin will be able to read the "nextmap" from the Cvar and use it as an Dynamic.
Nextmap:
http://forums.alliedmods.net/showthread.php?t=56689
Changelog
- 02-07-07 - First release
- 02-07-07 - 1.0.1
- Removed the dependacy on Nextmap (it does use it if its available)
- Fixed some comments
- Made the GetGameTime start on OnMapStart.