Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #define USING_BOOST_API
- #include <api_gtrsboost>
- #define PLUGIN "Autoreward GTRS Boost System"
- #define VERSION "1.0"
- #define AUTHOR "DecaK & klipica"
- new server_ip[24], g_iBoosted = -5, Array:aBoostList;
- enum _:booststatus_t
- {
- STATUS_FAILED = 0,
- STATUS_PENDING,
- STATUS_OK
- };
- enum _:BOOST_DATA
- {
- MSGID[34],
- PHONE[16],
- NAME[64],
- BOOSTTIME,
- booststatus_t:STATUS
- };
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_clcmd("say boost", "isboost")
- new BoostError: iError;
- if(!Boost_Initialize()) {
- iError = Boost_GetLastError();
- log_amx("Boost_Initialize() failed with error code #%d: %s", iError, ERRORS[iError]);
- }
- else funcRefreshList();
- get_user_ip(0, server_ip, charsmax(server_ip))
- aBoostList = ArrayCreate(24, 92)
- }
- public plugin_end() Boost_Cleanup();
- public isboost(id) {
- client_print(id, print_console, "********* Podaci o boostu *********")
- if(g_iBoosted == -5) client_print(id, print_console, "Nema podataka o boostu")
- else client_print(id, print_console, "Server %s boostovan.", g_iBoosted ? "je" : "nije")
- if(!ArraySize(aBoostList)) client_print(id, print_console, "Nema podataka o boost listi")
- else {
- new tBoost[BOOST_DATA], szTime[24];
- for(new i = 0; i < ArraySize(aBoostList); i++) {
- ArrayGetArray(aBoostList, i, tBoost);
- format_time(szTime, charsmax(szTime), "%d.%m.%Y / %H:%M", tBoost[BOOSTTIME]);
- client_print(id, print_console, "Ime: %s | Vreme: %s | Status: %d", tBoost[NAME], szTime, tBoost[STATUS]);
- }
- }
- client_print(id, print_console, "************************************")
- }
- 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(30.0, "funcRefreshList");
- }
- }
- public Boost_QueryResponse()
- {
- set_task(30.0, "funcRefreshList");
- new BoostError: iError = Boost_GetLastError();
- if(iError != BERR_NONE)
- {
- log_amx("Boost_QueryResponse() error #%d: %s", iError, ERRORS[iError]);
- return 0;
- }
- if(Boost_ServerExists(server_ip))
- g_iBoosted = true;
- else
- g_iBoosted = false;
- }
- public BoostList_Refreshed()
- {
- new BoostError: iError;
- if((iError = Boost_GetLastError()) != BERR_NONE)
- {
- log_amx("Error #%d occured: %s", iError, ERRORS[iError]);
- return 0;
- }
- aBoostList = Boost_GetList();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement