Hello. This is my first plugin I've actually wrote and it compiled... It works and so does the cvar I made. What it does is I've hardcoded some advertisements into it that will display every 60 seconds (or 1 minute), I want to share this plugin with others for their tsrp servers -- I forgot to mention that I made this for TSRP. The problem is, whenever it does display the advertisements, it shows all 5 of them instead of one at a time every 60 seconds.
Here is the code:
Code:
/*
==================================================================================================================
=== Advertisements Mod for TSRP Servers ===
==== Version 0.1 Alpha ====
==========================================================Author: -=[SD]=-Turkey a.k.a turkey2112=================
*/
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "PLUGIN"
#define VERSION "VERSION"
#define AUTHOR "AUTHOR"
public plugin_init()
{
register_plugin("Advertisements Mod", "0.1a", "turkey2112")
register_cvar("amx_advertsenable","1")
set_task(60.0,"advertise",0,"",0,"b")
}
public advertise()
{
if(!get_cvar_num("amx_advertsenable")) return PLUGIN_HANDLED
client_print(0,print_chat,"The MCPD is hiring! Apply on our forums today!") //Edit the text inside of quotes for your own adverts
client_print(0,print_chat,"Want to save lives? Join the MCMD today! Visit our forums to apply.")
client_print(0,print_chat,"Chase bank is looking for a new director! Do you have what it takes? Find out on our forums!")
client_print(0,print_chat,"Need a place to stay for the night? Visit Hotel Mecklenburg! Rooms starting at only $50!")
client_print(0,print_chat,"Good times, good drinks, good company... Come visit us at the Irish Pub!")
return PLUGIN_HANDLED
}
__________________