Top Awards by Dom1no_[KZ]

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
OS
Linux
Amx Mod X
ReAMXX 1.8.3
Билд
dunno hiden for users
Metamod
1.3.0.116
Meta модули
Код:
[ 1] Reunion, v0.1.0.92, 2018-02-11, by The Legion, see
[ 2] AMX Mod X, v1.8.3-Re, Dec 24 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 3] VoiceTranscoder, v2017RC3, 2017.02.12, by WPMG.PRoSToC0der, see http://vtc.wpmg.ru/
[ 4] ReSemiclip, v2.3.9, 13/02/17, by s1lent & Adidasman, see http://www.dedicated-server.ru/
[ 5] WHBlocker, v1.5.695, 2017-12-13, by s1lent, see http://www.aghl.ru/
[ 6] Rechecker, v2.5, Oct 21 2017, by s1lent, see http://www.dedicated-server.ru/
[ 7] MySQL, v1.8.3-Re, Oct 11 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org/
[ 8] SQLite, v1.8.3-Re, Oct 11 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org/
[ 9] CStrike, v1.8.3-Re, Dec 24 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 10] CSX, v1.8.3-Re, Dec 24 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org/
[ 11] Engine, v1.8.3-Re, Dec 24 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 12] FakeMeta, v1.8.3-Re, Dec 24 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 13] Fun, v1.8.3-Re, Dec 24 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 14] GeoIP, v1.8.3-Re, Oct 11 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org/
[ 15] hackdetector, v0.15.328.lite, 2016-12-17, by AGHL.RU Dev Team, see http://www.aghl.ru/
[ 16] Ham Sandwich, v1.8.3-Re, Dec 24 2016, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 17] ReAimDetector, v0.2.2, 2018-02-06, by ReHLDS Team, see http://www.dedicated-server.ru/
[ 18] ReAPI, v5.8.0.166-dev, 2019-04-14, by Asmodai & s1lent, see https://github.c
Плагины
Код:
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// LEGIONER
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// Admin Base Always One Has To Be Activated
;////////////////////////////////////////////////////////////////////////////////
adminhelp.amxx ; Admin Help Commands
admin.amxx ; Admin Base (Required For Any Admin Related)
; admin_sql.amxx ; Admin Base SQL Version (Comment admin.amxx)
admins_reload.amxx ; Enable amx_reloadadmins for everyone reloadadmins
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// Basic
;/////////////////////////////////////////////////////////////////////////////////
admincmd.amxx ; Basic Admin Console Commands
adminslots.amxx ; Slot Reservation
multilingual.amxx ; Multi Lingual Management
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// Menus
;/////////////////////////////////////////////////////////////////////////////////
menufront.amxx ; Front End For Admin Menus
cmdmenu.amxx ; Command Menu (Speech, Settings)
;newkickmenu.amxx
plmenu.amxx ; Players Menu (Kick, Ban, Client Cmds)
; telemenu.amxx ; Teleport Menu (Fun Module Required)
mapsmenu.amxx ; Maps Menu (Vote, Changelevel)
; pluginmenu.amxx ; Menus For Commands/Cvars Organized By: Plugin
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// Chat / Messages
;/////////////////////////////////////////////////////////////////////////////////
adminchat.amxx ; Console Chat Commands
antiflood.amxx ; Prevent Clients From Chat Flooding Server
scrollmsg.amxx ; Displays A Scrolling Message
imessage.amxx ; Displays Information Messages
adminvote.amxx ; Vote Commands
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// Map Related
;/////////////////////////////////////////////////////////////////////////////////
maphandler.amxx ; Adding and removing maps
nextmap.amxx ; Displays Next Map In Mapcycle
mapchooser.amxx ; Allows To Vote For Next Map
timeleft.amxx ; Displays Time Left On Map
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// Configuration
;/////////////////////////////////////////////////////////////////////////////////
pausecfg.amxx ; Allows To Pause And Unpause Some Plugins
statscfg.amxx ; Allows To Manage Stats Plugins Via Menu And Commands
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// Counter Strike
;/////////////////////////////////////////////////////////////////////////////////
statsx.amxx ; Stats On Death Or Round End (CSX Module Required)
; restmenu.amxx ; Restrict Weapons Menu
; miscstats.amxx ; Bunch Of Events Announcement For Counter Strike
; stats_logging.amxx ; Weapons Stats Logging (CSX Module Required)
; csstats.amxx ; Rank Calculation
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// More Plugins
;/////////////////////////////////////////////////////////////////////////////////
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// LEGIONER ANTI CHEAT
;/////////////////////////////////////////////////////////////////////////////////
rc_basechanger.amxx ; LEGIONER ANTI CHEAT CHETEBIS BAZEBI
rc_log.amxx ; LEGIONER ANTI CHEAT rechecker 2.5 rc_log
rc_logging.amxx ; LEGIONER ANTI CHEAT rechecker 2.5 rc_log
reaimdetector.amxx ; AIM Detector
;/////////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////// LEGIONER PLUGINS
;/////////////////////////////////////////////////////////////////////////////////
damager_advanced.amxx ; advanced bullet damage
parachute.amxx ; parashuti
ne_unlimitedammo.amxx ; ulevi tyviebi
restartround.amxx ; raundis auto restarti
unbanmenu.amxx ; banis moxsnis meniu
spectatorslist.amxx ; mayurebelta listi xel marjvniv ekranze
resetscore.amxx ; motamashes sheudzlia fragis ganuleba
c4time.amxx ; bombis dadebis dros bombis afetqebamde darchenili dro ekranze
fakeplayers.amxx ; speqtatoris botebi ORIGINALI DA ARA CRUZERAS NACHALICHARI
uptime.amxx ; gichvenebs serveris /uptime s
AdminCheck.amxx ; adminebis naxva /admins
xKillSayGiver.amxx debug ; 1000 killze adzlevs says
afk_slayer.amxx ; afk avtomaturi slay
afkbombtransfer.amxx ; BOMBis gadacema sxvaze roca bomba AFK aris
dproto.amxx ; logshi serverze shemosuli motamashis ipi
backweapons.amxx ; iaragi zurgze
next21_kill_assist.amxx ; ramdenime kacis fragi
motd.amxx ; MOTD naxva /motd
no_team_flash.amxx ; shenians ver gauflesheb
noplayers_map.amxx ; gadayavs FY_SNOW ze roca aravinaa serverze
SwichSpecTeam.amxx ; speqtatorshi gadasvla /spec /back
PrivateMessage.amxx ; piradshi micera /pm
InfoConnects.amxx ; shemomsvlelta statistika
custom_models.amxx ; adminebis modelebi
steam_say_prefix.amxx ; steamit motamashes ceris dros cin ucers [STEAM]
adminlisten.amxx ; admins sheudzlia yvelas chati naxos mkvdrebisac da cocxlebisac
nice_killer.amxx ; raundis saukeTeso motamashe
lie_flat.amxx ; iaragebi dzirs devs sworad
BadSpawnsPreventer.amxx ; If when you get respawned on bad spawn-point, one of you gotta be killed, this plugin prevents this.
allow_roundfinish.amxx ; When the time for the exchange of map end, the map will be changed when the round end
camera.amxx ; kameris xedvis shecvla
simple_online_logger.amxx ; top lists es imaxsovrebs ro SAY gasces
top_awards.amxx debug ; top 1 2 3 adzlevs SAYs
tops_award.amxx ; top 1 2 3 adzlevs SAYs
; abd.amxx ; advanced bullet damage
; top_by_gametime.amxx ; top 1 2 3 adzlevs SAYs
; antinamespam.amxx ; motamashes ukrdzalavs saxelze eweros serveris ip da gineba
; antiadvertising.amxx ; chatshi blokavs serveris ips da ginebas
; antivariable.amxx ; Anti Variable
; espanticheat.amxx ; Anticheat Esp Fix
; hackhunter.amxx ; Clientis BIND kontroli \"END \"DEL \"INS \"F9\" \"F12\"
; playerslist.amxx ; logshi serverze shemosuli motamashis ipi
; pingoptimize.amxx ; maqsimalurad akontrolebs motamashis pings
; ping_control.amxx ; serveridan agdebs im motamashes romelsac aqvs magali pingi
; assist.amxx ; ramdenime kacis fragi
; best_player.amxx ; raundis sauketeso motamashes bonusi
; kills_counter.amxx ; macxniv gicers ramdeni mokali
; admin_spec_esp.amxx ; speqtatoridan WH (wallhack) dakvirveba
; allinfo.amxx ; logshi serverze shemosuli motamashis ipi
; allspec.amxx ; yvelas speqtatorshi gadayvana say /allspec
; country_on_name_with_cvars.amxx ; nickis cin qveynis kodi
; adminlogs.amxx ; log all admin commands
; realnadedrops.amxx ; yumbarebis dayra sikvdilis mere
; armordrop.amxx ; bronis dayra sikvdilis mere
; advanced_slowmo.amxx ; matrica
; amx_menu.amxx ; Main menu
; amx_modmenu.amxx ; AMXmod menu
; CW_Menu.amxx ; Clan War menu /cw
; punkserver_mix.amxx ; MIX menu
; amx_exec.amxx ; Runs commands on the clients, necessary for various things in addons. amx_execall "say hey"
; alltag.amxx ; yvelas ucvlis nicks say /alltag
; amx_execall.amxx ; Runs commands on the clients, necessary for various things in addons. amx_execall "say hey"
; autolang.amxx ; Detect the client's location by looking at his IP and will set automatically his language
; no_retry.amxx ; Avoid using retry and reconect
; bet.amxx ; fsonis dadeba gundze
; amx_blockip.amxx ; motamashis IPs dablokva
; weapon_icon.amxx ; iaragis ikonkebi radaris qvesh
; vip_sc_1.amxx ; TAB scoreboardze adminzebi chans rogorc VIP
; refill_weapon_on_kill.amxx debug ; mchidis avtomatri gadatenva
; gag_me.amxx ; motamashis xmis gachumeba /gag
; throwing_knives.amxx ; danebis srola
Amxx Модули
Код:
;;;
; To enable a module, remove the semi-colon (;) in front of its name.
; If it's not here, simply add it its name, one per line.
; You don't need to write the _amxx part or the file extension.
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SQL Modules usually need to be enabled manually ;;
;; You can have any number on at a time. Use ;;
;; amx_sql_type in sql.cfg to specify the default ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;mysql
;sqlite
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Put third party modules below here. ;;
;; You can just list their names, without the _amxx ;;
;; or file extension. ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; These modules will be auto-detected and loaded ;;
;; as needed. You do not need to enable them here ;;
;; unless you have problems. ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cstrike
csx
engine
fakemeta
fun
geoip
hackdetector
hamsandwich
;native
nvault
reaimdetector
reapi
regex
;sockets
Ошибка
Код:
NL 05/09/2019 - 09:44:26: Start of error session.
L 05/09/2019 - 09:44:26: Info (map "de_dust2_a") (file "addons/amxmodx/logs/error_20190509.log")
L 05/09/2019 - 09:44:26: [AMXX] Displaying debug trace (plugin "top_awards.amxx", version "1.0")
L 05/09/2019 - 09:44:26: [AMXX] Run time error 4: index out of bounds
L 05/09/2019 - 09:44:26: [AMXX] [0] top_awards.sma::client_give_awards (line 118)
L 05/09/2019 - 09:44:35: [AMXX] Displaying debug trace (plugin "top_awards.amxx", version "1.0")
L 05/09/2019 - 09:44:35: [AMXX] Run time error 4: index out of bounds
L 05/09/2019 - 09:44:35: [AMXX] [0] top_awards.sma::client_give_awards (line 118)
L 05/09/2019 - 09:45:54: [AMXX] Displaying debug trace (plugin "top_awards.amxx", version "1.0")
L 05/09/2019 - 09:45:54: [AMXX] Run time error 4: index out of bounds
L 05/09/2019 - 09:45:54: [AMXX] [0] top_awards.sma::client_give_awards (line 118)
Исходник
Код:
/*
Copyright by Dom1no_[KZ]
2019 © https://vk.com/m.kent03
*/

#include <amxmodx>

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

#define PLUGIN "Top Awards"
#define VERSION "1.0"
#define AUTHOR "Dom1no_[KZ]"

/* Настройки */
#define IGNORE_FLAGS (ADMIN_CHAT|ADMIN_KICK)
// Игнорируемые флаги
// Закоментируйте если не требуется

#define STATS_SYSTEM 0 // Система записи статистики
// 0 - CSX
// 1 - CsStats MySQL by SKAJIbnEJIb
// 2 - CsStatsX SQL by serfreeman1337

#define MAX_AWARDS 256
// Максимальная количество наград

const Float: TIME = 3.0;
// Задержка в секундах перед проверкой игрока

enum _:DATA {
FLAGS[32],
MSG[128]
};
new g_arrAwardData[MAX_AWARDS][DATA], g_iDataSize = 1;
#if STATS_SYSTEM == 0
#include <csx>
#define get_player_stats get_user_stats
#endif
#if STATS_SYSTEM == 1
#include <csstats_mysql>
#endif
#if STATS_SYSTEM == 2
#include <csstatsx_sql>
#define get_player_stats get_user_stats_sql
#endif

public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);
}

public plugin_cfg(){
new szPath[64];
get_localinfo("amxx_configsdir", szPath, charsmax(szPath));
add(szPath, charsmax(szPath), "/top_awards.ini");

new iFile = fopen(szPath, "rt");
if(!iFile){
new szError[96];
formatex(szError, charsmax(szError), "File '%s' not found OR incorrect CHMOD!", szPath);
set_fail_state(szError);
}

new szBuffer[MAX_AWARDS];
while(!feof(iFile)){
fgets(iFile, szBuffer, charsmax(szBuffer));
trim(szBuffer);

if(!szBuffer[0] || szBuffer[0] == ';')
continue;

if(parse(szBuffer,
g_arrAwardData[g_iDataSize][FLAGS], charsmax(g_arrAwardData[][FLAGS]),
g_arrAwardData[g_iDataSize][MSG], charsmax(g_arrAwardData[][MSG])
) == 2) g_iDataSize++;
}
fclose(iFile);
}

public client_putinserver(id){
set_task(TIME, "client_give_awards", id);
}

public client_give_awards(id){
new g_iAccess, szName[32];
g_iAccess = get_user_flags(id);
get_user_name(id, szName, charsmax(szName));

if(!is_user_connected(id)){
return;
}
#if defined IGNORE_FLAGS
if(g_iAccess & IGNORE_FLAGS){
return;
}
#endif

#if STATS_SYSTEM == 0 || STATS_SYSTEM == 2
new szStats[8];
new iRank = get_player_stats(id, szStats, szStats);
#else
new szStats[22];
new iRank = csstats_get_user_stats(id, szStats);
#endif

if(iRank <= g_iDataSize){
set_user_flags(id, g_iAccess | read_flags(g_arrAwardData[iRank][FLAGS]));

replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!n", "^1");
replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!t", "^3");
replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!g", "^4");
replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "%name%", szName);

client_print_color(id, print_team_default, "%s", g_arrAwardData[iRank][MSG]);
}
else{
remove_user_flags(id, g_arrAwardData[iRank][FLAGS]);
}
}
Please help with this error

C++:
/*
    Copyright by Dom1no_[KZ]
    2019 © https://vk.com/m.kent03
*/

#include <amxmodx>

#if AMXX_VERSION_NUM < 183
    #include <colorchat>
#endif

#define    PLUGIN    "Top Awards"
#define    VERSION    "1.0"
#define    AUTHOR    "Dom1no_[KZ]"

/* Настройки */
#define IGNORE_FLAGS (ADMIN_CHAT|ADMIN_KICK)
    //    Игнорируемые флаги
    //    Закоментируйте если не требуется

#define    STATS_SYSTEM 0 // Система записи статистики
    //    0 - CSX
    //    1 - CsStats MySQL by SKAJIbnEJIb
    //    2 - CsStatsX SQL by serfreeman1337

#define MAX_AWARDS 256
    // Максимальная количество наград

const Float: TIME = 3.0;
    // Задержка в секундах перед проверкой игрока

enum _:DATA {
    FLAGS[32],
    MSG[128]
};
new g_arrAwardData[MAX_AWARDS][DATA], g_iDataSize = 1;
#if    STATS_SYSTEM == 0
    #include <csx>
    #define    get_player_stats get_user_stats
#endif
#if    STATS_SYSTEM == 1
    #include <csstats_mysql>
#endif
#if    STATS_SYSTEM == 2
    #include <csstatsx_sql>
    #define    get_player_stats get_user_stats_sql
#endif

public plugin_init(){
    register_plugin(PLUGIN, VERSION, AUTHOR);
}

public plugin_cfg(){
    new szPath[64];
    get_localinfo("amxx_configsdir", szPath, charsmax(szPath));
    add(szPath, charsmax(szPath), "/top_awards.ini");

    new iFile = fopen(szPath, "rt");
    if(!iFile){
        new szError[96];
        formatex(szError, charsmax(szError), "File '%s' not found OR incorrect CHMOD!", szPath);
        set_fail_state(szError);
    }

    new szBuffer[MAX_AWARDS];
    while(!feof(iFile)){
        fgets(iFile, szBuffer, charsmax(szBuffer));
        trim(szBuffer);

        if(!szBuffer[0] || szBuffer[0] == ';')
            continue;

        if(parse(szBuffer, 
            g_arrAwardData[g_iDataSize][FLAGS], charsmax(g_arrAwardData[][FLAGS]),
            g_arrAwardData[g_iDataSize][MSG], charsmax(g_arrAwardData[][MSG])
        ) == 2)    g_iDataSize++;
    }
    fclose(iFile);
}

public client_putinserver(id){
    set_task(TIME, "client_give_awards", id);
}

public client_give_awards(id){
    new g_iAccess, szName[32];
    g_iAccess = get_user_flags(id);
    get_user_name(id, szName, charsmax(szName));

    if(!is_user_connected(id)){
        return;
    }
    #if defined IGNORE_FLAGS
        if(g_iAccess & IGNORE_FLAGS){
            return;
        }
    #endif

    #if    STATS_SYSTEM == 0 || STATS_SYSTEM == 2
        new szStats[8];
        new iRank = get_player_stats(id, szStats, szStats);
    #else
        new szStats[22];
        new iRank = csstats_get_user_stats(id, szStats);
    #endif

    if(iRank <= g_iDataSize){
        set_user_flags(id, g_iAccess | read_flags(g_arrAwardData[iRank][FLAGS]));

        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!n", "^1");
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!t", "^3");
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!g", "^4");
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "%name%", szName);

        client_print_color(id, print_team_default, "%s", g_arrAwardData[iRank][MSG]);
    }
    else{
        remove_user_flags(id, g_arrAwardData[iRank][FLAGS]);
    }
}
 

g52

Заблокированные
Пользователь
Регистрация
8 Июн 2018
Сообщения
367
Симпатии
57
Shadowless, update AmxMod, I already talked about it, but for some reason removed my comment from the photo
обновите AmxMod, я уже говорил об этом, но по какой-то причине удалили мой комент с фото
 

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
Shadowless, update AmxMod, I already talked about it, but for some reason removed my comment from the photo
обновите AmxMod, я уже говорил об этом, но по какой-то причине удалили мой комент с фото
i cant do it :( hoster does not allow changing hosting amxx, help me solve this error :(
 

g52

Заблокированные
Пользователь
Регистрация
8 Июн 2018
Сообщения
367
Симпатии
57
Shadowless, Change the hoster in another way
Меняйте хостинг по-другому никак
 

perfectblood0

Команда форума
Администратор
Регистрация
29 Окт 2017
Сообщения
2.578
Симпатии
914
Пол
Женский
Shadowless, update AmxMod, I already talked about it, but for some reason removed my comment from the photo
обновите AmxMod, я уже говорил об этом, но по какой-то причине удалили мой комент с фото
Ну и зачем его обновлять, расскажите? Как связано это с ошибкой плагина.
 

fantom

Разработчик
Регистрация
11 Июн 2017
Сообщения
426
Симпатии
293
Пол
Мужской
Код:
new g_iAccess, szName[32];
    g_iAccess = get_user_flags(id);
    get_user_name(id, szName, charsmax(szName));

    if(!is_user_connected(id)){
        return;
    }
->
Код:
if(!is_user_connected(id)){
    return;
}
new g_iAccess, szName[32];
g_iAccess = get_user_flags(id);
get_user_name(id, szName, charsmax(szName));
 
K

kapangaIII

And this:
set_task(TIME, "client_give_awards", id);
->
set_task(TIME, "client_give_awards", id+71723);


public client_give_awards(id){
->
Код:
public client_give_awards(id){
id-=71723;
 

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
i got this after makeing both changes

C++:
/*
Copyright by Dom1no_[KZ]
2019 © https://vk.com/m.kent03
*/

#include <amxmodx>

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

#define    PLUGIN    "Top Awards"
#define    VERSION    "1.1"
#define    AUTHOR    "Dom1no_[KZ] ; Fixed By fantom & kapangaIII"

/* Настройки */
#define IGNORE_FLAGS (ADMIN_CHAT|ADMIN_KICK)
//    Игнорируемые флаги
//    Закоментируйте если не требуется

#define    STATS_SYSTEM 0 // Система записи статистики
//    0 - CSX
//    1 - CsStats MySQL by SKAJIbnEJIb
//    2 - CsStatsX SQL by serfreeman1337

#define MAX_AWARDS 256
// Максимальная количество наград

const Float: TIME = 3.0;
// Задержка в секундах перед проверкой игрока

enum _:DATA {
    FLAGS[32],
    MSG[128]
};
new g_arrAwardData[MAX_AWARDS][DATA], g_iDataSize = 1;
#if    STATS_SYSTEM == 0
#include <csx>
#define    get_player_stats get_user_stats
#endif
#if    STATS_SYSTEM == 1
#include <csstats_mysql>
#endif
#if    STATS_SYSTEM == 2
#include <csstatsx_sql>
#define    get_player_stats get_user_stats_sql
#endif

public plugin_init(){
    register_plugin(PLUGIN, VERSION, AUTHOR);
}

public plugin_cfg(){
    new szPath[64];
    get_localinfo("amxx_configsdir", szPath, charsmax(szPath));
    add(szPath, charsmax(szPath), "/top_awards.ini");
    
    new iFile = fopen(szPath, "rt");
    if(!iFile){
        new szError[96];
        formatex(szError, charsmax(szError), "File '%s' not found OR incorrect CHMOD!", szPath);
        set_fail_state(szError);
    }
    
    new szBuffer[MAX_AWARDS];
    while(!feof(iFile)){
        fgets(iFile, szBuffer, charsmax(szBuffer));
        trim(szBuffer);
        
        if(!szBuffer[0] || szBuffer[0] == ';')
            continue;
        
        if(parse(szBuffer,
        g_arrAwardData[g_iDataSize][FLAGS], charsmax(g_arrAwardData[][FLAGS]),
        g_arrAwardData[g_iDataSize][MSG], charsmax(g_arrAwardData[][MSG])
        ) == 2)    g_iDataSize++;
    }
    fclose(iFile);
}

public client_putinserver(id){
    set_task(TIME, "client_give_awards", id+71723);
}

public client_give_awards(id){
    id-=71723;
    if(!is_user_connected(id)){
        return;
    }
    new g_iAccess, szName[32];
    g_iAccess = get_user_flags(id);
    get_user_name(id, szName, charsmax(szName));
    
    #if defined IGNORE_FLAGS
    if(g_iAccess & IGNORE_FLAGS){
        return;
    }
    #endif
    
    #if    STATS_SYSTEM == 0 || STATS_SYSTEM == 2
    new szStats[8];
    new iRank = get_player_stats(id, szStats, szStats);
    #else
    new szStats[22];
    new iRank = csstats_get_user_stats(id, szStats);
    #endif
    
    if(iRank <= g_iDataSize){
        set_user_flags(id, g_iAccess | read_flags(g_arrAwardData[iRank][FLAGS]));
        
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!n", "^1");
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!t", "^3");
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!g", "^4");
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "%name%", szName);
        
        client_print_color(id, print_team_default, "%s", g_arrAwardData[iRank][MSG]);
    }
    else{
        remove_user_flags(id, g_arrAwardData[iRank][FLAGS]);
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
BUT error same :(

Код:
L 05/10/2019 - 23:15:11: [AMXX] Displaying debug trace (plugin "top_awards.amxx", version "1.1")
L 05/10/2019 - 23:15:11: [AMXX] Run time error 4: index out of bounds
L 05/10/2019 - 23:15:11: [AMXX]    [0] top_awards.sma::client_give_awards (line 119)
L 05/10/2019 - 23:16:22: [AMXX] Displaying debug trace (plugin "top_awards.amxx", version "1.1")
L 05/10/2019 - 23:16:22: [AMXX] Run time error 4: index out of bounds
L 05/10/2019 - 23:16:22: [AMXX]    [0] top_awards.sma::client_give_awards (line 119)
L 05/10/2019 - 23:17:18: [AMXX] Displaying debug trace (plugin "top_awards.amxx", version "1.1")
L 05/10/2019 - 23:17:18: [AMXX] Run time error 4: index out of bounds
L 05/10/2019 - 23:17:18: [AMXX]    [0] top_awards.sma::client_give_awards (line 119)
 
K

kapangaIII

А это нормально вообще? g_iDataSize = 1;
Show top_awards.ini.
 

georgeml

Скриптер
Постоялец
Регистрация
12 Сен 2017
Сообщения
595
Симпатии
314
Shadowless, ReHLDS/HLDS - Top Awards
C++:
remove_user_flags(id, g_arrAwardData[iRank][FLAGS]);
//зачем что-то удалять при входе игрока, если достаточно просто не выдавать
//при этом, если   iRank будет больше MAX_AWARDS , то в g_arrAwardData[iRank][FLAGS] будет выход за пределы массива
Данный плагин не пргоден для использования
 

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
Shadowless, ReHLDS/HLDS - Top Awards
C++:
remove_user_flags(id, g_arrAwardData[iRank][FLAGS]);
//зачем что-то удалять при входе игрока, если достаточно просто не выдавать
//при этом, если   iRank будет больше MAX_AWARDS , то в g_arrAwardData[iRank][FLAGS] будет выход за пределы массива
Данный плагин не пргоден для использования
what about removing that part of code?

Код:
    else{
        remove_user_flags(id, g_arrAwardData[iRank][FLAGS]);
    }
[DOUBLEPOST=1557586788][/DOUBLEPOST]i think its need to add if(get_user_flags(id) & read_flags( and remove that line (i dunno so much but understending whats coding means)
 

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
at the end i got this , with out any error on server logs and compilation error... gona test if it will work...

C++:
/*
Copyright by Dom1no_[KZ]
2019 © https://vk.com/m.kent03
*/

#include <amxmodx>

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

#define    PLUGIN    "Top Awards"
#define    VERSION    "1.0"
#define    AUTHOR    "Dom1no_[KZ]"

/* Настройки */
#define IGNORE_FLAGS (ADMIN_CHAT|ADMIN_LEVEL_H)
//    Игнорируемые флаги
//    Закоментируйте если не требуется

#define    STATS_SYSTEM 0 // Система записи статистики
//    0 - CSX
//    1 - CsStats MySQL by SKAJIbnEJIb
//    2 - CsStatsX SQL by serfreeman1337

#define MAX_AWARDS 256
// Максимальная количество наград

const Float: TIME = 3.0;
// Задержка в секундах перед проверкой игрока

enum _:DATA {
    FLAGS[32],
    MSG[128]
};
new g_arrAwardData[MAX_AWARDS][DATA], g_iDataSize = 1;
#if    STATS_SYSTEM == 0
#include <csx>
#define    get_player_stats get_user_stats
#endif
#if    STATS_SYSTEM == 1
#include <csstats_mysql>
#endif
#if    STATS_SYSTEM == 2
#include <csstatsx_sql>
#define    get_player_stats get_user_stats_sql
#endif

public plugin_init(){
    register_plugin(PLUGIN, VERSION, AUTHOR);
}

public plugin_cfg(){
    new szPath[64];
    get_localinfo("amxx_configsdir", szPath, charsmax(szPath));
    add(szPath, charsmax(szPath), "/top_awards.ini");
   
    new iFile = fopen(szPath, "rt");
    if(!iFile){
        new szError[96];
        formatex(szError, charsmax(szError), "File '%s' not found OR incorrect CHMOD!", szPath);
        set_fail_state(szError);
    }
   
    new szBuffer[MAX_AWARDS];
    while(!feof(iFile)){
        fgets(iFile, szBuffer, charsmax(szBuffer));
        trim(szBuffer);
       
        if(!szBuffer[0] || szBuffer[0] == ';')
            continue;
       
        if(parse(szBuffer,
        g_arrAwardData[g_iDataSize][FLAGS], charsmax(g_arrAwardData[][FLAGS]),
        g_arrAwardData[g_iDataSize][MSG], charsmax(g_arrAwardData[][MSG])
        ) == 2)    g_iDataSize++;
    }
    fclose(iFile);
}

public client_putinserver(id){
    set_task(TIME, "client_give_awards", id+71723);
}

public client_give_awards(id){
    id-=71723;
    if(is_user_bot(id)) return
    if(!is_user_connected(id)){
        return;
    }
    new g_iAccess, szName[32];
    g_iAccess = get_user_flags(id);
    get_user_name(id, szName, charsmax(szName));
    #if defined IGNORE_FLAGS
    if(g_iAccess & IGNORE_FLAGS){
        return;
    }
    #endif
   
    #if    STATS_SYSTEM == 0 || STATS_SYSTEM == 2
    new szStats[8];
    new iRank = get_player_stats(id, szStats, szStats);
    #else
    new szStats[22];
    new iRank = csstats_get_user_stats(id, szStats);
    #endif
   
    if(iRank <= g_iDataSize){
        set_user_flags(id, g_iAccess | read_flags(g_arrAwardData[iRank][FLAGS]));
       
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!n", "^1");
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!t", "^3");
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "!g", "^4");
        replace_all(g_arrAwardData[iRank][MSG], charsmax(g_arrAwardData[][MSG]), "%name%", szName);
       
        client_print_color(id, print_team_default, "%s", g_arrAwardData[iRank][MSG]);
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
 
Сверху Снизу