Код:
#include <amxmodx>
new szReklamaPlayHud[512];
public plugin_init() register_plugin("Reklama Hud", "1.0", "Freeman4iK");
public plugin_precache()
{
new szCfgDir[64], szCfgFile[128];
get_localinfo("amxx_configsdir", szCfgDir, charsmax(szCfgDir));
formatex(szCfgFile, charsmax(szCfgFile), "%s/reklama.ini", szCfgDir);
switch(file_exists(szCfgFile))
{
case 0: log_to_file("%s/reklama_error.log", "File ^"%s^" not found!", szCfgDir, szCfgFile);
case 1:
{
new szBuffer[256], iLine, iLen;
while(read_file(szCfgFile, iLine++, szBuffer, charsmax(szBuffer), iLen))
{
if(!iLen || szBuffer[0] == ';') continue;
parse(szBuffer, szReklamaPlayHud, charsmax(szReklamaPlayHud));
while(replace(szReklamaPlayHud, charsmax(szReklamaPlayHud), "!n", "^n")) {}
set_task(1.0, "Task_PlayeReklama", _, _, _, "b");
break;
}
}
}
}
public Task_PlayeReklama()
{
new sDeadPlayers[32], iDeadCount, i;
get_players(sDeadPlayers, iDeadCount, "bc");
for (i = 0; i < iDeadCount; i++) {
set_hudmessage(200, 150, 0, 0.02, 0.25, 2, 0.1);
show_hudmessage(i, szReklamaPlayHud);
}