Ok, so I change my mind a little bit. This is what I think I might do:
PHP Code:
#include <amxmodx>
#include <colorchat>
new g_szFile[64]
public plugin_init()
{
register_plugin("Map requests", "1.0", "Drekes")
register_concmd("requestmap", "addmap")
new datadir[64]
get_localinfo("amxx_datadir", datadir, 63)
format(g_szFile, 63, "%s/maprequests.ini", datadir)
// Advertisements
register_cvar("amx_mapreq_advertdelay", "400")
new Float:fDelay = get_cvar_float("amx_mapreq_advertdelay")
if( fDelay > 0.1 )
set_task(fDelay, "advert", _, _, _, "b")
}
public advert()
{
ColorChat(0, NORMAL, "[AMXX]: Want a map that isn't on the server? Typ ^x03requestmap mapname ^x01in console")
}
public addmap(id)
{
new szData[35], szWrite[128]
new szName[33], szSteamID[35]
read_argv(1, szData, charsmax(szData))
get_user_name(id, szName, 32)
get_user_authid(id, szSteamID, 34)
formatex(szWrite, 127, "%s ID: %s requests map: %s", szName, szSteamID, szData)
write_file(g_szFile, szWrite)
console_print(id, "Your map request has been succesfully added. We will add it to the server soon.")
}
So, it means that the advertisements are either on during the whole map or off during the whole map.
__________________