-
Notifications
You must be signed in to change notification settings - Fork 3
/
Msg.as
26 lines (19 loc) · 804 Bytes
/
Msg.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
CCVar@ g_Msg;
CCVar@ g_Interval;
CScheduledFunction@ g_pThinkFunc = null;
void PluginInit() {
g_Module.ScriptInfo.SetAuthor("incognico");
g_Module.ScriptInfo.SetContactInfo("https://discord.gg/qfZxWAd");
g_Module.ScriptInfo.SetMinimumAdminLevel(ADMIN_YES);
@g_Msg = CCVar("msg", "Welcome to the twilightzone! Type .help for server commands.", "The text to display", ConCommandFlag::AdminOnly);
@g_Interval = CCVar("interval", 421.0f, "Repeat every x seconds", ConCommandFlag::AdminOnly);
MapInit();
}
void MapInit() {
if (g_pThinkFunc !is null)
g_Scheduler.RemoveTimer(g_pThinkFunc);
@g_pThinkFunc = g_Scheduler.SetInterval("msgthink", g_Interval.GetFloat());
}
void msgthink() {
g_PlayerFuncs.ClientPrintAll(HUD_PRINTTALK, "[Info] " + g_Msg.GetString() + "\n");
}