Отладка. Формирование меню.

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
56
Реакции
46
Помог
1 раз(а)
Ошибка
Run time error 4: index out of bounds:
players_fps.sma::Show (line 52)
players_fps.sma::ShowMenu (line 95)
players_fps.sma::ShowMenu (line 99)
ОС
Windows
Amx Mod X
1.9.0.5249
Билд
3.7.0.692-dev
ReGamedll
5.11.0.418-dev
Версия Metamod
v1.3.0.128
Список метамодулей
[ 1] VoiceTranscoder  RUN   -    voicetranscoder.dll     v2017RC3     ini  ANY   ANY
[ 2] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5249 ini Start ANY
[ 3] Reunion RUN - reunion_mm.dll v0.1.0.92 ini Start Never
[ 4] POD-Bot mm RUN - podbot_mm.dll vV3B23a ini Chlvl ANY
[ 5] ReSemiclip RUN - resemiclip_mm.dll v2.3.9 ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm.dll v2.5 ini Chlvl ANY
[ 7] SQLite RUN - sqlite_amxx.dll v1.9.0.5249 pl2 ANY ANY
[ 8] ReAimDetector RUN - reaimdetector_amxx.dll v0.2.2 pl2 ANY Never
[ 9] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5249 pl2 ANY ANY
[10] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5249 pl2 ANY ANY
[11] CStrike RUN - cstrike_amxx.dll v1.9.0.5249 pl2 ANY ANY
[12] Fun RUN - fun_amxx.dll v1.9.0.5249 pl2 ANY ANY
[13] Engine RUN - engine_amxx.dll v1.9.0.5249 pl2 ANY ANY
[14] CSX RUN - csx_amxx.dll v1.9.0.5249 pl2 ANY ANY
[15] VTC AMXX API RUN - vtcapi_amxx.dll v2017 RC pl2 ANY ANY
Список плагинов
[  1] Admin Base              1.9.0.5249  AMXX Dev Team     admin.amxx       running
[ 2] Admin Commands 1.9.0.5249 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5249 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5249 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5249 AMXX Dev Team multilingual.am running
[ 6] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 7] Map Manager: Sub Plugi 0.1 Mistrick mapmanager_subp running
[ 8] AmxModMenu 1.2 Sn1kO{Dmitriy.T) menufront.amxx running
[ 9] Commands Menu 1.9.0.5249 AMXX Dev Team cmdmenu.amxx running
[ 10] Players Menu 1.9.0.5249 AMXX Dev Team plmenu.amxx running
[ 11] Maps Menu 1.9.0.5249 AMXX Dev Team mapsmenu.amxx running
[ 12] Plugin Menu 1.9.0.5249 AMXX Dev Team pluginmenu.amxx running
[ 13] Admin Chat 1.9.0.5249 AMXX Dev Team adminchat.amxx running
[ 14] Anti Flood 1.9.0.5249 AMXX Dev Team antiflood.amxx running
[ 15] Scrolling Message 1.9.0.5249 AMXX Dev Team scrollmsg.amxx running
[ 16] Info. Messages 1.9.0.5249 AMXX Dev Team imessage.amxx running
[ 17] Admin Votes 1.9.0.5249 Wildness Team adminvote.amxx running
[ 18] NextMap 1.9.0.5249 AMXX Dev Team nextmap.amxx stopped
[ 19] Nextmap Chooser 1.9.0.5249 AMXX Dev Team mapchooser.amxx stopped
[ 20] TimeLeft 1.9.0.5249 AMXX Dev Team timeleft.amxx running
[ 21] Pause Plugins 1.9.0.5249 AMXX Dev Team pausecfg.amxx running
[ 22] Stats Configuration 1.9.0.5249 AMXX Dev Team statscfg.amxx running
[ 23] StatsX 1.9.0.5249 AMXX Dev Team statsx.amxx running
[ 24] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 25] Lite Translit 2.8 neygomon lite_translit.a running
[ 26] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 27] Reset Score 1.0 SKAJIbnEJIb resetscore_rbs. running
[ 28] Menu 1.0 WaT_1 Menu.amxx running
[ 29] Advanced Experience Sy 0.5 Vega serfreeman1337 aes_main.amxx running
[ 30] AES: CStrike Addon 0.5 Vega serfreeman1337 aes_exp_cstrike running
[ 31] AES: Informer 0.5 Vega serfreeman1337 aes_informer.am running
[ 32] AES: Admin Tools 0.5 Vega serfreeman1337 aes_exp_editor. running
[ 33] AES: Bonus System 0.5 Vega serfreeman1337 aes_bonus_syste running
[ 34] AES: Bonus CSTRIKE 0.5 Vega serfreeman1337 aes_bonus_cstri running
34 plugins, 32 running
Автор плагина
Empowers and Admin
Версия плагина
1.0
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <engine>
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#define print_team_default DontChange
#define print_team_grey Grey
#define print_team_red Red
#define print_team_blue Blue
#include <dhudmessage>
#endif

#define PLUGIN "Players FPS"
#define VERSION "1.0"
#define AUTHOR "Empowers and Admin"
#define Menu_Keys (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)

new g_fps[33][11]
new g_i[33]

new MenuPos
new MenuPlayers[32]
new g_maxplayers

new cvar_Show
new cvar_Show_sfc
new cvar_Show_Bots

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

register_menucmd(register_menuid("ShowFPS"), Menu_Keys, "Pressed")

register_clcmd("say /showfps","Show")
register_clcmd("say_team /showfps","Show")
register_clcmd("say /sfc","show_in_console")
register_clcmd("say_team /sfc","show_in_console")
register_clcmd("amx_scf","show_in_console")

cvar_Show = register_cvar("amx_fps_show","0")
cvar_Show_sfc = register_cvar("amx_fps_sfc","0")
cvar_Show_Bots = register_cvar("amx_fps_bots","0")


g_maxplayers = get_maxplayers()
}

public Show(id){

if(get_pcvar_num(cvar_Show) || is_user_admin(id)){

ShowMenu(id, MenuPos = 0)

}else{

client_print_color(id,print_team_red,"[ShowFps] Only admin can use it")

}
return PLUGIN_HANDLED
}

public ShowMenu(id, position) {
if (position < 0) { return 0; }

new i, k
new MenuBody[255]
new CurrentKey = 0
new Start = position * 7
new Num
new UserName[32]

get_players(MenuPlayers, Num)
if (Start >= Num) { Start = position = MenuPos = 0; }
new Len = format(MenuBody, 255, "\yFPS игроков\R%d/%d^n\w^n", position+1, (Num / 7 + ((Num % 7) ? 1 : 0 )) )
new End = Start + 7
new Keys = (1<<9)
if (End > Num) { End = Num; }

for(i=Start;i<End;i++) {
k = MenuPlayers[i]
get_user_name(k, UserName, 31)
Keys |= (1<<CurrentKey++)
new fps = get_user_fps(k)

if(is_user_bot(k)){

if(get_pcvar_num(cvar_Show_Bots))
Len += format(MenuBody[Len], (255-Len), "\d%i. %s Fps:%s%d^n", CurrentKey, UserName,(fps > 104)? "\r" : "\d",fps)

}else{
Len += format(MenuBody[Len], (255-Len), "\w%i. %s Fps:%s%d^n", CurrentKey, UserName,(fps > 104)? "\r" : "\w",fps)
}
}
if (End != Num) {
format(MenuBody[Len], (255-Len), "^n\w9. Далее^n%s", position ? "\w0. Вернуться" : "\w0. Выход")
Keys |= (1<<8)
}
else {
format(MenuBody[Len], (255-Len), "^n%s", position ? "\w0. Вернуться" : "\w0. Выход")
}
show_menu(id, Keys, MenuBody, -1, "ShowFPS")
return 0
}

public Pressed(id, key) {
switch (key) {
case 8: ShowMenu(id, ++MenuPos)
case 9: ShowMenu(id, --MenuPos)

default: {

new PlayerID = MenuPlayers[MenuPos * 7 + key]
new UserName[32]
get_user_name(PlayerID, UserName, 31)

ShowMenu(id,MenuPos)
}
}
return PLUGIN_HANDLED
}
public show_in_console(id) {

if(get_pcvar_num(cvar_Show_sfc) || is_user_admin(id)){

new name[32]
new ping,loss

console_print(id,"NAME | FPS | Ping | Loss")

for(new i=1;i<=g_maxplayers;i++) {
if(!is_user_connected(i) || is_user_bot(i))
continue;

get_user_ping(i,ping,loss)
get_user_name(i,name,31)

console_print(id,"%s | %ifps | %iping | %iloss",name,get_user_fps(i),ping,loss)
}
}else{
console_print(id,"[ShowFps] Only admin can use it")
}
return PLUGIN_HANDLED
}

public client_putinserver(id)
set_task(0.1, "count", id, "", 0, "b")

public client_disconnected(id)
remove_task(id)

public client_PreThink(id)
g_fps[id][10]++

public count(id) {

if ( g_i[id] < 9 )
g_i[id]++;
else
g_i[id] = 0;

g_fps[id][g_i[id]] = g_fps[id][10];
g_fps[id][10] = 0;
}

get_user_fps(id) {
new i
new j = 0

for ( i = 0; i < 10; i++ )
j += g_fps[id][i]

return j - 5
}
Всем привет. Благодарен за помощь и было бы здорово если бы объяснили, что именно ему не нравится.
 
В этой теме было размещено решение! Перейти к решению.
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу