PHP Code:
#pragma semicolon 1
#define DEBUG
char file[512];
int g_iAd;
#define PLUGIN_AUTHOR "SpirT"
#define PLUGIN_VERSION "1.0"
#include <sourcemod>
#include <sdktools>
#include <colors>
#pragma newdecls required
public Plugin myinfo =
{
name = "[Ads] SpirT",
author = PLUGIN_AUTHOR,
description = "",
version = PLUGIN_VERSION,
url = ""
};
public void GetKeyValuesFile()
{
BuildPath(Path_SM, file, sizeof(file), "configs/SomeAds.cfg");
}
public void OnMapStart()
{
CreateTimer(10.0, Timer_DisplayAds, _, TIMER_REPEAT);
}
public Action Timer_DisplayAds(Handle timer, Handle hndl)
{
g_iAd++;
SendAds();
}
void SendAds()
{
KeyValues kv = new KeyValues("SomeAds");
kv.ImportFromFile(file);
if (!kv.JumpToKey(g_iAd))
g_iAd = 0;
else
{
char Ad[256];
kv.GetString("message", Ad, sizeof(Ad));
CPrintToChatAll(Ad);
}
delete kv;
}
__________________
I do make plugins upon requests, so hit me up on discord if you're interested: Stefan Milivojevic#5311