AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   Adverts system (https://forums.alliedmods.net/showthread.php?t=57379)

Wiebbe 07-03-2007 16:40

Adverts system
 
2 Attachment(s)
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.

Wiebbe 07-03-2007 16:43

Re: Adverts system
 
And i wanted to post a question, this plugin works like a charm, but during compile it does give out a warning. Could anyone tell me how to fix this?

Even with the warning it never crashed in the 2/3 hours i had it running so it does work..

^BuGs^ 07-03-2007 16:45

Re: Adverts system
 
Warnings are allowed. They usually say something is not used. Good job. :)

ferret 07-03-2007 16:52

Re: Adverts system
 
Just some suggestions:
  • Fix the comments at the top, still says Mapchooser and describes Mapchooser
  • remove reliance on Nextmap. If you can't find nextmap, just don't replace your nextmap dynamic. Then the plugin works with or without, rather than requiring a plugin that only needed for one small peice.
  • You should probably set g_fStartTime in OnMapStart too, just to be sure.

Wiebbe 07-03-2007 17:07

Re: Adverts system
 
Quote:

Originally Posted by ferret (Post 498190)
Just some suggestions:
  • Fix the comments at the top, still says Mapchooser and describes Mapchooser
  • remove reliance on Nextmap. If you can't find nextmap, just don't replace your nextmap dynamic. Then the plugin works with or without, rather than requiring a plugin that only needed for one small peice.
  • You should probably set g_fStartTime in OnMapStart too, just to be sure.

Im embaressed by the comments :>

Sounds like a good idea for the nextmap plugin, ill implement those idea's.

bobbobagan 07-04-2007 21:28

Re: Adverts system
 
can you add a {tickrate} command so it can read what the tickrate of your server is? thanks

yester64 07-05-2007 14:44

Re: Adverts system
 
well, have it like mani. add tikrate, nextmap etc.
but actually i really would like to see to specify the timerate it will be displayed.
otherwise its a great plugin. once we really need.

Quote:

Originally Posted by bobbobagan (Post 498819)
can you add a {tickrate} command so it can read what the tickrate of your server is? thanks


TSCDan 07-05-2007 15:38

Re: Adverts system
 
Instead of only having one display location, perhaps multiple locations at once?

Wiebbe 07-05-2007 18:48

Re: Adverts system
 
Quote:

Originally Posted by yester64 (Post 499109)
well, have it like mani. add tikrate, nextmap etc.
but actually i really would like to see to specify the timerate it will be displayed.
otherwise its a great plugin. once we really need.

i will add tickrate, anything else you can think off?

Nextmap is already in btw ;)

I will see if i can work the location stuff..

Extreme_One 07-06-2007 07:45

Re: Adverts system
 
I'd also like the ability for adverts to be shown in multiple positions.

But that top panel placement often obscures the radar so I'd love it if you could make the top panel advert only display for dead players (or spectators) whilst the other advert positions are displayed to all.


All times are GMT -4. The time now is 13:45.

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