Kod: Tümünü seç
#define PLUGIN "Spectator Banner Ads"
#define VERSION "1.2"
#define AUTHOR "iG_os"
#include <amxmodx>
#define SVC_DIRECTOR 51
// sum of tga files
#define TGASUM 1
// tga of banners
new szTga[TGASUM][] ={
"gfx/komando.tga"
}
new pCVAR_Tga
new g_SendOnce[33]
public plugin_precache()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
pCVAR_Tga = register_cvar("spec_acik", "1")
if (get_pcvar_num(pCVAR_Tga))
{
for (new i=0; i<TGASUM; i++)
precache_generic(szTga[i])
}
}
public client_putinserver(id)
{
set_task(3.0,"ifsa",id)
}
public ifsa(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()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/