#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <dhudmessage>
#define fTask 15.0
new const Autor[] = "Chatto."
new const Name[] = "Notifications of festivities"
new const Vers[] = " 1.0 "
new const szHolydays[ ][ ] =
{
"4",
"18",
"1",
"15",
"29",
"6",
"20"
}
new const szMonths[ ][ ] =
{
"August",
"September",
"October"
}
new gMaxPlayers;
public plugin_init()
{
register_plugin(Name, Vers, Autor)
register_logevent("RoundStart", 2, "1=Round_Start")
gMaxPlayers = get_maxplayers();
}
public RoundStart( )
{
for( new i = 1; i < gMaxPlayers; i++ )
{
set_task( fTask, "Recording", i )
}
}
public Recording( id )
{
new Month[33], Day[12];
get_time( "%B", Month, charsmax(Month) )
get_time( "%d", Day, charsmax(Day) )
new Christmas = str_to_num(szHolydays[ 0 ]) - str_to_num(Day)
new Halloween = str_to_num(szHolydays[ 3 ]) - str_to_num(Day)
new LastDay_ofAge = str_to_num(szHolydays[ 1 ]) - str_to_num(Day)
if( equali( Month, szMonths[0] ) )
{
ColorChat(id, GREEN, "[Nyeremenyjatek]^1 Meg^3 %d^1 nap van hatra a nyeremenyjatekig.", Halloween )
}
{
ColorChat(id, GREEN, "[Nyeremenyjatek]^1 Meg^3 %d^1 nap van hatra a nyeremenyjatekig.", Christmas )
ColorChat(id, GREEN, "[Nyeremenyjatek]^1 Meg^3 %d^1 nap van hatra a nyeremenyjatekig.", LastDay_ofAge )
}
{
if( equal( Day, szHolydays[3] ) )
{
new name[33]
get_user_name(id, name, 32)
ColorChat(id, GREEN, "[Nyeremenyjatek]^1 A mai nap kezdetet vette a nyeremenyjatek. Sok sikert %s", name)
}
}
}