/* Spectator Banner(PICTURE) Ads
Have you ever seen the banner pictuer(left up corner) when watching HLTV?
We can see it ingame now when you are death or become spectator.
Should it using by Valve Ads? Who know! Enjoy it!
Ramdon select one tga file when map was loaded.
Tested on CS/CZ, may works on other MOD.
/* Install Instructions::
Put the tga files in (cstrike\gfx) folder
Put the banner_ads.amxx in (cstrike\addons\amxmodx\plugins) folder
spec_banner_ads 1/0 // Enable & Disable Function
The tga file only support 24b color format.
The zip file contain tga only fit 800*600 display resolution of client.
Change the size if most client used difference resolution.
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("joined_team", 3, "1=joined team")
pCVAR_Tga = register_cvar("spec_banner_ads", "1")
if (get_pcvar_num(pCVAR_Tga))
for (new i=0; i<TGASUM; i++)
precache_generic(szTga[i])
public client_putinserver(id)
new loguser[80], name[32]
read_logargv(0, loguser, 79)
parse_loguser(loguser, name, 31)
new id = get_user_index(name)
if ( get_pcvar_num(pCVAR_Tga) && g_SendOnce[id] && is_user_connected(id) )
new index = random_num( 0, TGASUM - 1)
// send show tga command to client
message_begin( MSG_ONE, SVC_DIRECTOR, _, id )
write_byte( strlen( szTga[index]) + 2 ) // command length in bytes
write_byte( DRC_CMD_BANNER )
write_string( szTga[index] ) // banner file