Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <colorchat>
- #include <api_gtrsboost>
- #define TASK_REFRESH 2048
- new g_pInfo;
- new g_iBoosted = false;
- new const szCountries[][] =
- {
- "Srbija", "Bosna", "Crna Gora", "Hrvatska", "Macedonia",
- "Slovenia", "Norway", "Bulgaria", "Czech Republic", "Estonia",
- "Finland", "Romania", "Kosovo", "Albania", "Austria",
- "France", "Germany", "Switzerland", "Poland", "Sweden",
- "Italy", "Argentina", "Brazil", "Peru", "Greece", "India"
- };
- new szServerIp[24];
- public plugin_init()
- {
- register_plugin("How to boost server", "3.0", "Ikac");
- register_clcmd("say /boost", "clcmd_Boost");
- register_clcmd("say_team /boost", "clcmd_Boost");
- g_pInfo = register_cvar("htbs_info", "300");
- set_task(get_pcvar_float(g_pInfo), "Info" , _ , _ , _ , "b");
- get_user_ip(0, szServerIp, charsmax(szServerIp));
- new BoostError: iError;
- if(!Boost_Initialize())
- {
- iError = Boost_GetLastError();
- log_amx("Boost_Initialize() failed with error code #%d: %s", iError, ERRORS[iError]);
- return;
- }
- funcRefreshList();
- }
- public funcRefreshList()
- {
- if(!Boost_RefreshList())
- {
- new BoostError: iError = Boost_GetLastError();
- log_amx("Boost_RefreshList() failed with error code #%d: %s", iError, ERRORS[iError]);
- set_task(120.0, "funcRefreshList", TASK_REFRESH);
- g_iBoosted = false;
- }
- }
- public Boost_QueryResponse()
- {
- set_task(120.0, "funcRefreshList", TASK_REFRESH);
- new BoostError: iError = Boost_GetLastError();
- if(iError != BERR_NONE)
- {
- log_amx("Boost_QueryResponse() error #%d: %s", iError, ERRORS[iError]);
- g_iBoosted = false;
- return;
- }
- if(Boost_ServerExists(szServerIp))
- g_iBoosted = true;
- else
- g_iBoosted = false;
- }
- public plugin_end()
- {
- Boost_Cleanup();
- }
- public clcmd_Boost(id)
- {
- if(g_iBoosted)
- {
- ColorChat(id, GREEN, "^4[Boost]^1 Sorry, our server is already boosted. Please, try again later.");
- ColorChat(id, GREEN, "^4[Boost]^1 Nazalost, server je vec bustovan. Molimo vas, pokusajte kasnije.");
- }
- else
- set_task(1.0, "taskMenu", id);
- }
- public taskMenu(id)
- {
- new iMenu = menu_create("\rIzaberi Drzavu:", "hndBoostMenu");
- for(new i=0; i < sizeof(szCountries); i++)
- menu_additem(iMenu, szCountries[i]);
- menu_display(id, iMenu);
- }
- public hndBoostMenu(id, iMenu, iItem)
- {
- if(iItem == MENU_EXIT)
- {
- menu_destroy(iMenu);
- return PLUGIN_HANDLED;
- }
- new szMotd[64];
- switch(iItem)
- {
- case 0:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/srb.html");
- case 1:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/bih.html");
- case 2:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/cg.html");
- case 3:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/hrv.html");
- case 4:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/mac.html");
- case 5:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/slo.html");
- case 6:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/nor.html");
- case 7:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/bul.html");
- case 8:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/cze.html");
- case 9:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/est.html");
- case 10:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/fin.html");
- case 11:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/ro.html");
- case 12:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/ko.html");
- case 13:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/alb.html");
- case 14:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/aus.html");
- case 15:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/slo.html");
- case 16:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/fra.html");
- case 17:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/ger.html");
- case 18:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/swi.html");
- case 19:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/pol.html");
- case 20:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/swe.html");
- case 21:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/ita.html");
- case 22:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/arg.html");
- case 23:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/bra.html");
- case 24:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/per.html");
- case 25:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/gre.html");
- case 26:
- formatex(szMotd,charsmax(szMotd),"addons/amxmodx/configs/szMotd/ind.html");
- }
- show_motd(id, szMotd);
- return PLUGIN_HANDLED;
- }
- public Info()
- {
- ColorChat(0, GREEN, "[APB]^1 Ako zelis da dobijes VIP-a say^3 /boost");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement