Участник
Пользователь
- Сообщения
- 209
- Реакции
- 28
- Помог
- 8 раз(а)
- Ошибка
-
L 08/18/2018 - 23:13:01: [AMXX] Displaying debug trace (plugin "gamecms_time_awards.amxx")
L 08/18/2018 - 23:13:01: [AMXX] Run time error 4: index out of bounds
L 08/18/2018 - 23:13:01: [AMXX] [0] gamecms_time_awards.sma::CheckAwards (line 201)
L 08/18/2018 - 23:13:01: [AMXX] [1] gamecms_time_awards.sma::player_spawn (line 160)
L 08/18/2018 - 23:13:51: [AMXX] Displaying debug trace (plugin "gamecms_time_awards.amxx")
L 08/18/2018 - 23:13:51: [AMXX] Run time error 4: index out of bounds
L 08/18/2018 - 23:13:51: [AMXX] [0] gamecms_time_awards.sma::CheckAwards (line 201)
L 08/18/2018 - 23:13:51: [AMXX] [1] gamecms_time_awards.sma::player_spawn (line 160)
L 08/18/2018 - 23:15:12: [AMXX] Displaying debug trace (plugin "gamecms_time_awards.amxx")
L 08/18/2018 - 23:15:12: [AMXX] Run time error 4: index out of bounds
L 08/18/2018 - 23:15:12: [AMXX] [0] gamecms_time_awards.sma::CheckAwards (line 201)
L 08/18/2018 - 23:15:12: [AMXX] [1] gamecms_time_awards.sma::player_spawn (line 160)
L 08/18/2018 - 23:16:31: [AMXX] Displaying debug trace (plugin "gamecms_time_awards.amxx")
L 08/18/2018 - 23:16:31: [AMXX] Run time error 4: index out of bounds
L 08/18/2018 - 23:16:31: [AMXX] [0] gamecms_time_awards.sma::CheckAwards (line 201)
L 08/18/2018 - 23:16:31: [AMXX] [1] gamecms_time_awards.sma::player_spawn (line 160)
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.8.2 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Feb 14 2013, 00:55:09
Build ID: 1.8.2 61:2ae84f7c0a97
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.6.3.7/Stdio (cstrike)
ReHLDS version: 3.4.0.653-dev
Build date: 10:42:01 May 22 2018 (1501)
Build from: https://github.com/dreamstalker/rehlds/commit/87a2d17
- ReGamedll
-
ReGameDLL version: 5.7.0.295-dev
Build date: 15:10:22 Feb 19 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/aa329db
- Версия Metamod
-
Metamod-r v1.3.0.121, API (5:13)
Metamod-r build: 22:55:21 Mar 12 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/89b29af
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.8.2 ini Start ANY
[ 3] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 4] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 5] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 6] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 7] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 8] WHBlocker RUN - whblocker_mm_i386.so v1.5.695 ini Chlvl ANY
[ 9] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[10] MySQL RUN - mysql_amxx_i386.so v1.8.2 pl2 ANY ANY
[11] SQLite RUN - sqlite_amxx_i386.so v1.8.2 pl2 ANY ANY
[12] ReParachute RUN - parachute_amxx_i386.so v1.1 Beta pl2 ANY ANY
[13] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl2 ANY Never
[14] ReAPI RUN - reapi_amxx_i386.so v5.5.0.150-dev pl2 ANY Never
[15] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.2 pl2 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.2 pl2 ANY ANY
[17] Engine RUN - engine_amxx_i386.so v1.8.2 pl2 ANY ANY
[18] CSX RUN - csx_amxx_i386.so v1.8.2 pl2 ANY ANY
[19] CStrike RUN - cstrike_amxx_i386.so v1.8.2 pl2 ANY ANY
[20] Fun RUN - fun_amxx_i386.so v1.8.2 pl2 ANY ANY
20 plugins, 20 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] GameCMS_API 5.2.4 zhorzh78 gamecms_api_5.2 running
[ 2] FreshBans 1.3.8b kanagava fresh_bans_138. running
[ 3] DopBan 3.0.3b kanagava dop_ban303_.amx running
[ 4] WebHS 0.1 kanagava fb_web_online.a running
[ 5] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 6] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 7] Advanced MapChooser 1.3 neygomon map_chooser.amx running
[ 8] Rank Menu 1.1 h1k3 rankmenu.amxx running
[ 9] [182] StatsX RBS 18.03.24 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 10] Stats Configuration 18.05.15 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 11] [182] Army Ranks Ultim 18.05.15 SKAJIbnEJIb army_ranks_ulti running
[ 12] AR Double 14.12.02 SKAJIbnEJIb ar_double.amxx running
[ 13] [182] BonusMenu RBS 18.05.15 SKAJIbnEJIb bonusmenu_rbs.a running
[ 14] [182] Team Balancer 17.10.30 Sanlerus team_balancer.a running
[ 15] Ping Control 1.31 neygomon Ping_Control.am running
[ 16] GameCMS_GagManager 1.4.4 API5 zhorzh78 gamecms_gagmana debug
[ 17] [182] Chat RBS 18.03.24 SKAJIbnEJIb chat_rbs.amxx running
[ 18] [ReAPI] Random Weapons 2.4.6 neugomon random_weapons_ running
[ 19] [ReAPI] No Team Flash 1.0 ReHLDS Team noteamflash.amx running
[ 20] Auto Demo Recorder 2.2.1 F@nt0M demo_recorder.a running
[ 21] [182] Map Spawns Edito 17.08.27 iG_os & SKAJIbnE MapSpawnsEditor running
[ 22] [ReAPI] Custom Models 1.6.1 neugomon custom_models.a running
[ 23] GameName Changer 1.0 neugomon gamename_change running
[ 24] Advert Messages 1.22 neygomon adverts.amxx running
[ 25] AFK Control 1.4.1 [Rnd neygomon afk_control.amx running
[ 26] Lite VoteBan 1.4 neygomon lite_voteban.am running
[ 27] Menus Front-End 1.5 neugomon menufront_end.a running
[ 28] Players Menu 1.7 neugomon players_menu.am running
[ 29] [182] Ultimate Informe 17.10.30 SKAJIbnEJIb ultimate_inform running
[ 30] [182] Skill ELO 18.03.24 SKAJIbnEJIb skill_elo.amxx running
[ 31] [182] CsStats MySQL 18.08.09 SKAJIbnEJIb csstats_mysql.a running
[ 32] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 33] VIP_by_Aki Private Aki_Lucky vip_by_Aki.amxx paused
[ 34] Admin Check 1.51 OneEyed admin_check.amx running
[ 35] Bullet Damage 0.0.1 ConnorMcLeod bullet_damage.a running
[ 36] Lite AwpLimit 1.09 neygomon awp.amxx paused
[ 37] Vip Test 1.0 daywer vip_test.amxx running
[ 38] Admin Commands 1.8.2 AMXX Dev Team admincmd.amxx running
[ 39] Admin Votes 1.8.2 AMXX Dev Team adminvote.amxx running
[ 40] Admin Chat 1.8.M AMXX Dev Team adminchat.amxx running
[ 41] Commands Menu 1.8.2 AMXX Dev Team cmdmenu.amxx running
[ 42] Maps Menu 1.4.1 neugomon mapsmenu.amxx running
[ 43] CS Misc. Stats 1.8.2 AMXX Dev Team miscstats.amxx running
[ 44] Multi-Lingual System 1.8.2 AMXX Dev Team multilingual.am running
[ 45] Pause Plugins 1.8.2 AMXX Dev Team pausecfg.amxx running
[ 46] Items Restrict 1.0 s1lent items_restrict. running
[ 47] TimeLeft 1.8.2 AMXX Dev Team timeleft.amxx running
[ 48] Plugin Menu 1.8.2 AMXX Dev Team pluginmenu.amxx running
[ 49] Models Replacement 0.0.2 ConnorMcLeod | V models_replacem running
[ 50] Onlinetime Awards 0.1 sonyx atop_vip.amxx running
[ 51] Lite Admin ESP 1.0 neygomon admin_esp.amxx running
[ 52] GameCMS Time Awards 1.4 API_5 zhorzh78 gamecms_time_aw debug
52 plugins, 50 running
- Автор плагина
- zhorzh78
- Версия плагина
- 1.4 API_5
- Исходный код
-
#include <amxmodx>
#include <nvault>
#include <hamsandwich>
#include <cstrike>
#include <gamecms5>
#define PLUGIN "GameCMS Time Awards"
#define VERSION "1.4 API_5"
#define AUTHOR "zhorzh78"
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif
#if !defined AMXX_VERSION_RELEASE
#define client_disconnected client_disconnect
#endif
/*========= НАСТРОЙКИ =============*/
const Float:maxRealMoney = 35.0; //Максимальная сумма на балансе, при наличии которой бонус в деньгах не выдается
#define REALMONEY // Выдавать деньги на баланс сайта CameCMS
//#define SET_FLAGS // Выдавать флаги доступа
#define PRUNETIME 20 // максимальный перерыв в игре после которого будет сброс таймера, минут
// Все массивы должны иметь равное количество значений. Призы выдаются только 1 раз за каждый промежуток времени!
new timeAward[] = {0, 30, 60, 90, 120, 180, 240, 300, 360}; // время в игре (минут) за которое дается награда.
new moneyAward[] = {0, 0, 0, 0, 0}; // игровые деньги (для отключения указать все нули)
#if defined REALMONEY
new Float:shillAward[] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8}; // сумма на баланс сайта (для отключения указать все нули)
new bool:g_API = true;
#endif
#if defined SET_FLAGS
new const flagsAward[][] = {"", "", "", "", ""}; // флаги доступа (для отключения оставить пустым)
#endif
#define DEBUG // Включить, если "что-то не так"
#if defined DEBUG
new const logFile[] = "gametime_award.log";
#endif
/*==================================*/
enum _:eTimeData
{
bool:isInGame,
timeStart,
timeSum,
timePrize,
timeNonStop,
timeSession
}
new const nvFile[] = "time_award";
new AuthIDs[MAX_PLAYERS + 1][24];
new PlTimer[MAX_PLAYERS + 1][eTimeData];
new nvHandle, giRound;
#if defined REALMONEY
public OnAPIPluginStop()
{
log_amx("GameCMS API is not loaded. Some functions are not aviable");
g_API = false;
}
#endif
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("TeamInfo", "team_assign", "a");
RegisterHam(Ham_Spawn, "player", "player_spawn", 1);
register_event("HLTV", "StartRound", "a", "1=0", "2=0");
}
public plugin_cfg()
{
#if defined REALMONEY
if(is_plugin_loaded("GameCMS_API") == INVALID_PLUGIN_ID)
{
log_amx("GameCMS_API is not loaded. Some functions are not aviable");
g_API = false;
}
#endif
nvHandle = nvault_open(nvFile);
if(nvHandle == INVALID_HANDLE)
{
log_amx("Error opening file ^"%s.vault^"!", nvFile);
pause("ad");
return;
}
nvault_prune(nvHandle, 0, get_systime() - PRUNETIME*60);
}
public StartRound()
{
giRound++;
}
public client_authorized(id)
{
get_user_authid(id, AuthIDs[id], charsmax(AuthIDs[]));
arrayset(PlTimer[id], 0, eTimeData);
}
public team_assign()
{
new id; id = read_data(1)
new Team[2]; read_data(2, Team, charsmax(Team))
switch(Team[0])
{
case 'T', 'C':
{
if(!PlTimer[id][isInGame])
{
PlTimer[id][isInGame] = true;
new timestamp, tmpstr[32];
if(nvault_lookup(nvHandle, AuthIDs[id], tmpstr, charsmax(tmpstr), timestamp))
{
if(timestamp + PRUNETIME*60 < get_systime())
{
#if defined DEBUG
log_to_file(logFile, "team_assign.. Removing an existing client- %d", id);
#endif
nvault_remove(nvHandle, AuthIDs[id]);
return;
}
new tmpOut[2][16];
parse(tmpstr, tmpOut[0], sizeof(tmpOut[]), tmpOut[1], sizeof(tmpOut[]));
PlTimer[id][timeSum] = str_to_num(tmpOut[0]);
PlTimer[id][timePrize] = str_to_num(tmpOut[1]);
nvault_remove(nvHandle, AuthIDs[id]);
}
#if defined DEBUG
log_to_file(logFile, "team_assign.. Client in game: client- %s | timeSum- %d | prize- %d", AuthIDs[id], PlTimer[id][timeSum], PlTimer[id][timePrize]);
#endif
}
}
default: StopCounting(id);
}
}
public player_spawn(id)
{
if(!PlTimer[id][isInGame] || !is_user_alive(id))
return;
if(!PlTimer[id][timeStart])
{
PlTimer[id][timeStart] = get_user_time(id);
return;
}
FnCalculate(id);
if(giRound > 3)
CheckAwards(id, PlTimer[id][timeSum]);
}
public FnCalculate(id)
{
new tmptime = get_user_time(id);
PlTimer[id][timeNonStop] = tmptime - PlTimer[id][timeStart];
PlTimer[id][timeSum] = PlTimer[id][timeNonStop] >= 0 ? PlTimer[id][timeSum] + PlTimer[id][timeNonStop] : 0;
//PlTimer[id][timeSum] += PlTimer[id][timeNonStop] = tmptime - PlTimer[id][timeStart];
PlTimer[id][timeStart] = tmptime;
#if defined DEBUG
log_to_file(logFile, "FnCalculate.. Client- %s | timeStart- %d, timeSum- %d", AuthIDs[id], PlTimer[id][timeStart], PlTimer[id][timeSum]);
#endif
}
public StopCounting(id)
{
if(!PlTimer[id][isInGame])
return;
FnCalculate(id);
PlTimer[id][timeSession] += PlTimer[id][timeNonStop];
new vData[32];
formatex(vData, charsmax(vData), "%d %d", PlTimer[id][timeSum], PlTimer[id][timePrize]);
nvault_set(nvHandle, AuthIDs[id], vData);
#if defined DEBUG
log_to_file(logFile, "StopCounting.. Client- %s | timeSum- %d", AuthIDs[id], PlTimer[id][timeSum]);
#endif
PlTimer[id][isInGame] = false;
}
public CheckAwards(id, itime)
{
for(new i = charsmax(timeAward); i > 0; i--)
{
if(timeAward[i] <= itime/60 && PlTimer[id][timePrize] < i)
{
new szAwtext[160], sztmp[50], len;
formatex(szAwtext, charsmax(szAwtext), "^1Ты играешь ^4%d минут^1, получаешь призы:", itime/60);
if(moneyAward[i])
{
formatex(sztmp, charsmax(sztmp), " [^4%d $^1]", moneyAward[i]);
len += add(szAwtext, charsmax(szAwtext), sztmp);
cs_set_user_money(id, cs_get_user_money(id) + moneyAward[i]);
}
#if defined REALMONEY
if(shillAward[i] > 0.0 && g_API && cmsapi_is_user_member(id) && cmsapi_get_user_money(id) < maxRealMoney)
{
formatex(sztmp, charsmax(sztmp), " [^4%.2f рублей^1]", shillAward[i]);
len += add(szAwtext, charsmax(szAwtext), sztmp);
cmsapi_add_user_money(id, shillAward[i]);
}
#endif
#if defined SET_FLAGS
new flags;
if(flagsAward[i][0] && (~(get_user_flags(id)) & (flags = read_flags(flagsAward[i]))))
{
formatex(sztmp, charsmax(sztmp), " ^4флаг доступа ^1^"%s^"", flagsAward[i]);
len += add(szAwtext, charsmax(szAwtext), sztmp);
if(g_API)
cmsapi_set_user_flags(id, flagsAward[i], -1, "ТОП по времени");
else
set_user_flags(id, flags);
}
#endif
if(len)
{
client_print_color(id, 0, szAwtext);
PlTimer[id][timePrize] = i;
}
#if defined DEBUG
log_to_file(logFile, "CheckAwards.. Client- %s | %s", AuthIDs[id], szAwtext);
#endif
break;
}
}
}
public client_disconnected(id)
{
StopCounting(id);
}
public plugin_end()
nvault_close(nvHandle);
public plugin_natives()
{
set_native_filter("native_filter");
register_native("cmsta_get_user_realtime", "native_cmsta_get_user_realtime");
}
public native_filter(const name[], index, trap)
return !trap ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
public native_cmsta_get_user_realtime()
return PlTimer[get_param(1)][timeSession];
Спасибо заранее. Уменьшил
на
Ну и связанные с этим параметры, ошибок больше нет.
19 Авг 2018
Код:
new timeAward[] = {0, 30, 60, 90, 120, 180, 240, 300, 360};
Код:
new timeAward[] = {0, 30, 60, 90, 120};
19 Авг 2018
В этой теме было размещено решение! Перейти к решению.