I wrote by phone, that is, not tested and there may be errors.
PHP Code:
#include <amxmodx>
new bool:UserMsg[33]
new AdsCvar, AdsHandler
public plugin_init()
{
register_clcmd("say /messagestop", "MsgHandler")
AdsCvar = register_cvar("ads_time", "40")
}
public client_putinserver(id)
{
if(!is_user_bot(id))
{
AdsHandler = get_pcvar_num(AdsCvar)
UserMsg[id] = true
CountDown(id)
}
}
public CountDown(id)
{
if(!UserMsg[id]) return
AdsHandler --
if(AdsHandler > 0)
{
set_hudmessage(0, 0, 255, -1.0, 0.29, 0, 6.0, 40.0);
show_hudmessage(id, "Welcom To Public Server^nAds: xxxx^nxxxxxx^nxxxxxx")
set_task(1.0, "CountDown", id)
}
else
{
remove_task(id)
}
}
public MsgHandler(id)
{
UserMsg[id] = false
client_print(id, print_chat, "You %s the ads.", UserMsg[id] ? "enable" : "disable")
return PLUGIN_HANDLED
}
__________________