- Katılım
- 17 Mayıs 2017
- Mesajlar
- 263
- Aktiflik Skoru
- 96
- Web sitesi
- www.countermerkezi.net
- Silah
- AK-47
- Cinsiyet
- Bay
Spec Banner Reklamı + Sma
Yazarlar:
- iG_os*
- Server'e giren oyuncuların sol üst resim reklamı göstermeye yarayan eklentidir.
- amxmodx
Kurulum ;
PHP:
#define PLUGIN "Spectator Banner Ads"
#define VERSION "0.1.16"
#define AUTHOR "iG_os"
#include <amxmodx>
#define SVC_DIRECTOR 51 // come from util.h
#define DRC_CMD_BANNER 9 // come from hltv.h
// sum of tga files
#define TGASUM 2
// tga of banners
new szTga[TGASUM][] ={
"gfx/countermerkezi.tga", // kendinize göre düzenleyiniz - resminizin uzantısı mutlaka .tga olmalıdır.
"gfx/countermerkezi.tga" // kendinize göre düzenleyiniz - resminizin uzantısı mutlaka .tga olmalıdır.
}
new pCVAR_Tga
new g_SendOnce[33]
public plugin_precache()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("joined_team", 3, "1=joined team")
pCVAR_Tga = register_cvar("anafor_banner_ads", "1")
if (get_pcvar_num(pCVAR_Tga))
{
for (new i=0; i<TGASUM; i++)
precache_generic(szTga[i])
}
}
public client_putinserver(id)
{
g_SendOnce[id] = true
}
public joined_team()
{
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) )
{
// random select one tga
new index = random_num( 0, TGASUM - 1)
g_SendOnce[id] = false
// 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
message_end()
}
}
PHP:
cstrike/addons/amxmodx/configs/plugins.ini'yi açıp
cm_specbanner.amxx yazip kaydediniz.