Curent Version: v1.1
[Dec 26, 2012]
V1.1 - Changed all entries of Adds -> Ads.
Description:
Show advertisments(ads) via overlays while player is dead or spectating. Made for CSS but should work on other mods as well.
Example Screenshot:
Edit: Need an overlay example ))...
Requirements:
morecolors
Translations :
*Russian
*English
pm with translation to add
Cvars:
Automade on first load.
Code:
Code:
// This file was auto-generated by SourceMod (v1.4.5-dev)
// ConVars for plugin "adsoverlays.smx"
// Version of AdsOverlays plugin
// -
// Default: "1.1"
sm_adsoverlays "1.1"
// Show ads to vips or root
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_ao_showtovip "0"
// How often ads change
// -
// Default: "10.0"
sm_ao_time "10.0"
// Trigger to stop showing ads
// -
// Default: "!stop"
sm_ao_triggerstop "!stop"
Commands:
sm_ao number - Shows mentioned ad to root
!stop - Stops showing ads (no flag required)
To install:
Unzip in cstike/
Edit ads.txt
Ad overlays paths in adons/sourcemod/configs/ads.txt. It should not contain anything other that paths to overlays. 1 line 1 path. All overlays should be placed in materials folder
Example of ads.txt:
Code:
overlays/adsoverlays/ad1
overlays/adsoverlays/ad2
overlays/youmaychangethis/ad3
eventhis/adsoverlays/vip
NOTE THE DIFFERENCE IN ads.txt AND REAL PATHS. THE PLUGIN AUTOMATICALLY adds 2 files (vmt and vtf) from that 1 line in ads.txt. Moreover omit "materials/" part in path to overlay!
Real paths of files would be:
Code:
materials/overlays/adsoverlays/ad1.vmt
materials/overlays/adsoverlays/ad1.vtf
materials/overlays/adsoverlays/ad2.vmt
materials/overlays/adsoverlays/ad2.vtf
materials/overlays/youmaychangethis/ad3.vmt
materials/overlays/youmaychangethis/ad3.vtf
materials/eventhis/adsoverlays/vip.vmt
materials/eventhis/adsoverlays/vip.vtf
Note the difference, in ads.txt there's only 1 line per path and no need to mention extensions.
Overlays Tutorial:
Basically you need a transparent image (1024x1024 sized), then you can add layers with you ad.
I made a grid in Photoshop and highlighted some spots that can be used for placing your ads onto them. See attachments. Note that probably you should transform your ad (change from 100% to 75% of original wide) to make it look good. Then, when you have a 1024x1024 png or tga image, you should use a png\tga to vtf converter. A plugin for Paint.net can be found here
http://nemesis.thewavelength.net/index.php?c=225 , it works ). When you got vtf, you need vmt.
VTF:
1. Download and install paint.net -
http://www.getpaint.net/download.html
2. Install VTF Plug-In for Paint.NET -
http://nemesis.thewavelength.net/index.php?c=225
3. Follow instructions -
http://**************/photo/my-images/11/vtfe.png/
VMT:
It's just a simple txt file with vmt extension. Download example.vmt from attachments and open it with text editor.
You will see this:
Code:
"UnlitGeneric"
{
// Original shader: BaseTimesVertexColorAlphaBlendNoOverbright
"$translucent" 1
"$basetexture" "overlays\addsoverlays\example"
//"$vertexcolor" 1
"$no_fullbright" 1
"$ignorez" 1
}
Now change overlays\addsoverlays\example to path to your overlay if needed. Don't write
materials\overlays\addsoverlays\example (materials folder is already in plugin). Save the file.
Now put VMT and VTF file in folder you mentioned above(so 2 files will be in materials\overlays\addsoverlays\ folder).
ads.txt:
Edit ads.txt and replace example with name you mentioned (if needed).
Code:
overlays/adsoverlays/example
Credits:
If anyone can make a good overlay example I will update the plugin and give credits.