Advanced lottery error

Сообщения
290
Реакции
28
Помог
2 раз(а)
Ошибка
L 03/25/2019 - 18:54:45: Start of error session.
L 03/25/2019 - 18:54:45: Info (map "de_mjolby6") (file "addons/amxmodx/logs/error_20190325.log")
L 03/25/2019 - 18:54:45: [AMXX] Displaying debug trace (plugin "advanced_lottery.amxx", version "0.5")
L 03/25/2019 - 18:54:45: [AMXX] Run time error 4: index out of bounds
L 03/25/2019 - 18:54:45: [AMXX] [0] advanced_lottery.sma::LotteryMenu (line 75)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5241 (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: Jan 30 2019 07:09:07
Built from: https://github.com/alliedmodders/amxmodx/commit/2110037
Build ID: 5241:2110037
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.668-dev
Build date: 09:47:42 Sep 29 2018 (1631)
Build from: https://github.com/dreamstalker/rehlds/commit/89be216
ReGamedll
ReGameDLL version: 5.7.0.322-dev
Build date: 11:41:14 Jan 13 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/7398bb7
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
[ 1] SafeNameAndChat  RUN   -    SafeNameAndChat.so          v1.1            ini  ANY   ANY  
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5241 ini Start ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 8] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 9] ReAPI RUN - reapi_amxx_i386.so v5.8.0.163-dev pl4 ANY Never
[10] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl4 ANY ANY
[11] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl4 ANY Never
[12] Engine RUN - engine_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[15] MySQL RUN - mysql_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[16] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[17] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[18] Fun RUN - fun_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Damager Advanced 1.1.2 Radius (based on damager_advance running
[ 2] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 3] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 4] AES: Informer 0.5 Vega serfreeman1337 aes_informer.am running
[ 5] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 6] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste paused
[ 7] AES: Bonus CSTRIKE 0.5.9 [REA serfreeman1337/s aes_bonus_cstri running
[ 8] AES Bonus: Flags 0.2 Sonyx aes_bonus_flags running
[ 9] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 10] FreshBans 1.4.0b kanagava fresh_bans_140_ running
[ 11] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 12] Lista admini (amx_who) www.play-a Un Biban whobun.amxx running
[ 13] RE Me&HP 1.1 neygomon, AcE re_sayhp.amxx running
[ 14] unknown unknown unknown flash.amxx running
[ 15] Team Transfer 2.1 UnFoRgIvEn transfer_chat.a running
[ 16] MOTD Commands 1.3 OciXCrom crx_motdcommand running
[ 17] Admin Base 1.9.0.5241 AMXX Dev Team admin.amxx running
[ 18] Admin Commands 1.9.0.5241 AMXX Dev Team admincmd.amxx debug
[ 19] Commands Menu 1.9.0.5241 AMXX Dev Team cmdmenu.amxx running
[ 20] Menus Front-End 1.9.0.5241 AMXX Dev Team menufront.amxx running
[ 21] SHOW IP + LAST IP 2.0 Alka + x amx_showip_last running
[ 22] Players Menu 1.9.0.5241 AMXX Dev Team plmenu.amxx running
[ 23] Pause Plugins 1.9.0.5241 AMXX Dev Team pausecfg.amxx running
[ 24] Admin Help 1.9.0.5241 AMXX Dev Team adminhelp.amxx running
[ 25] Multi-Lingual System 1.9.0.5241 AMXX Dev Team multilingual.am running
[ 26] Plugin Menu 1.9.0.5241 AMXX Dev Team pluginmenu.amxx running
[ 27] Admin Votes 1.9.0.5241 AMXX Dev Team adminvote.amxx running
[ 28] Admin Chat 1.8.1.3746 AMXX Dev Team adminchat.amxx running
[ 29] Private Message 1.0 Denzer pm.amxx debug
[ 30] CSStatsX SQL 0.7.4+1 serfreeman1337 csstatsx_sql.am running
[ 31] CSXSQL: Onlinetime Awa 0.2 serfreeman1337 csstatsx_playti running
[ 32] Items Restrict Ultimat 0.0.4 Vaqtincha items_restrict_ running
[ 33] AES: StatsX 0.5 Vega serfreeman1337 aes_statsx_cstr running
[ 34] Best Player MOTD 1.2.1 OciXCrom crx_bestplayer. running
[ 35] Simple Menu 2.1.1 OciXCrom crx_simplemenu. debug
[ 36] Restricted Names 1.1 Hattrick JM3Ch3R nick.amxx running
[ 37] Whatsapp_Group_Request 3.2 CrAzY MaN whatsapp_group_ running
[ 38] Quick and No Scope Det 1.2 EFFx QuickNoScopeD.a running
[ 39] SERVER TASKS 2.0 HATTRICK (HTTRCK server_tasks.am running
[ 40] Advanced Lottery 0.5 Nordic Warrior advanced_lotter debug
[ 41] StatsX 1.9.0.5241 AMXX Dev Team statsx.amxx running
[ 42] Stats Configuration 1.9.0.5241 AMXX Dev Team statscfg.amxx running
[ 43] Advertising Manager 2.0 Javekson advertising_man running
[ 44] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 45] Bomb Count Down HUD/Vo 0.2 RuS Mawe4ka117 bcd_hudvoice_ti running
[ 46] Ping Faker 1.5a MeRcyLeZZ pingfaker_count running
[ 47] unknown unknown unknown fake.amxx running
[ 48] Last Maps Time 0.0.1 Exolent last_maps_time. running
[ 49] CFG Slash 1.0 aNNakin cfg_slash.amxx running
[ 50] [ReAPI] TopRoundDamage 1.0.5 Dager* *.* -G- damage_round.am running
[ 51] Fall Damage HP Restore 0.0.1 Vaqtincha FallDamageHpRes running
[ 52] WeaponState Remember 0.0.4 Vaqtincha weaponstate_rem running
[ 53] Game Description Advan 1.0 fl0wer gamedesc_advanc running
[ 54] Kills Counter 0.3 serfreeman1337 kills_counter.a running
[ 55] Weapon Icon 1.2 hoboman313/Zenix weapon_icon.amx running
[ 56] Dead Messages 1.1 maFFyoZZyk deadmessages.am stopped
[ 57] Activitate Admini 2.0c Askhanar activitate.amxx running
[ 58] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 59] Auto Round Restart 1.0 LondoN eXtream restartr.amxx running
[ 60] Drop Pistols on Death 0.0.4 Vaqtincha reapi_dead_pist running
[ 61] Simple Online Logger 10.04.18 mx?! simple_online_l running
[ 62] Trial Access 10.04.18 mx?! trial_access.am running
[ 63] Slap/Slay Team 1.0 Kobra slaylslapteam.a running
[ 64] VIP Menu [CS.PLAYARENA 0.15 Leo_[BH](tradus vip_reapi.amxx running
[ 65] Color Flash Screen 1.6.4 Radius (Stimul i color_flash_scr running
[ 66] Invisible Spectator 1.0 ReHLDS Team invisible_spect running
[ 67] Ultimate Fire in the H 2.0 OciXCrom crx_fireintheho running
[ 68] Check Admin & Vip 2.2 Leo_[BH] check_admin_vip running
[ 69] Slay Losers 1.1.6 [email protected] slay_losers.amx running
[ 70] Map Manager: Core 3.0.0 Mistrick map_manager_cor running
[ 71] Map Manager: Scheduler 0.1.0 Mistrick map_manager_sch running
[ 72] Map Manager: Rtv 0.0.4 Mistrick map_manager_rtv running
[ 73] Map Manager: Nominatio 0.0.8 Mistrick map_manager_nom running
[ 74] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 75] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 76] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 77] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 78] Map Manager: Advanced 0.0.4 Mistrick map_manager_adv running
[ 79] Hide HUD/Menu on Vote 1.2.2 d3m37r4 hide_hud_and_me running
[ 80] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 81] Team Select 1.5.0 F@nt0M teamselect.amxx running
[ 82] Force Gag 1.2 zorken zilla_gag.amxx running
[ 83] Parachute 1.1 maeStro | neygom parachute.amxx running
[ 84] [ReAPI:AMXX] Buy Nades 0.1 F@nt0M Buy_Nades_Timeo running
[ 85] Knife Duel with Telepo 1.2 neygomon knife_duel.amxx running
85 plugins, 83 running
Автор плагина
Nordic Warrior
Версия плагина
0.5
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define VERSION "0.5"

#define TIME_FOR_RETRY 30 // Время между использованием лотереи
#define WIN_SOUND // Закомментируйте, если хотите отключить звук при выйгрыше
#define SAVE // Закомментируйте, если не хотите, чтобы джекпот переходил на следующую карту (требуется модуль nvault)
//#define ROUND 3 // Раскомментируйте, если хотите, чтобы лотерея работала с N раунда (можно подставить своё число)
//#define INFORMER_HUD // Раскомментируйте, если хотите, чтобы информер был постоянно активен
//#define ONLY_ALIVE // Раскомментируйте, если хотите, чтобы лотерея была доступна только живым

new const BETS[] = {
300, 500, 1000, 1500 // Здесь вписываем ставки. (Не больше 8!)
};

new g_Jackpot, g_LastTry, g_SyncHud, g_NowUsed[MAX_PLAYERS];

#if defined SAVE
#include <nvault>
new g_Save;
#endif

#if defined ROUND
new g_Round;
#endif

public plugin_init()
{
register_plugin("Advanced Lottery", VERSION, "Nordic Warrior");

register_clcmd("say /lot", "LotteryMenu");

#if defined INFORMER_HUD
set_task_ex(1.5, "informer", .flags = SetTask_Repeat);
#else
register_clcmd("say /jp", "informer");
#endif

register_menu("Lottery menu", 1023, "LotteryMenu_handler");
register_dictionary("adv_lottery.txt");

#if defined SAVE
g_Save = nvault_open("adv_lottery");
g_Jackpot = nvault_get(g_Save, "999");
#endif

#if defined ROUND
register_event("TextMsg", "game_start", "a", "2=#Game_Commencing", "2=#Game_will_restart_in");
register_event("HLTV", "round_start", "a", "1=0", "2=0");
#endif

g_SyncHud = CreateHudSyncObj();
}

#if defined WIN_SOUND
public plugin_precache()
{
precache_sound("adv_lottery/win_simple.wav");
precache_sound("adv_lottery/win_jackpot.wav");
}
#endif

public LotteryMenu(id)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED;

new menu[MAX_MENU_LENGTH], iLen;
new money = cs_get_user_money(id);
new GameTime = get_systime();
new keys = MENU_KEY_0;

g_LastTry = g_NowUsed[id];

new TimeRemaining = TIME_FOR_RETRY - (GameTime - g_LastTry);

if(TIME_FOR_RETRY > (GameTime - g_LastTry))
{
client_print_color(id, print_team_default, "^3[^4%L^3] %L", LANG_PLAYER, "TAG", LANG_PLAYER, "PAUSE", TIME_FOR_RETRY, TimeRemaining);
}
#if defined ROUND
else if(g_Round < ROUND)
{
client_print_color(id, print_team_default, "^3[^4%L^3] %L", LANG_PLAYER, "TAG", LANG_PLAYER, "TOO_EARLY", ROUND, g_Round);
}
#endif
#if defined ONLY_ALIVE
else if(!is_user_alive(id))
{
client_print_color(id, print_team_default, "^3[^4%L^3] %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ONLY_ALIVE");
}
#endif
else
{
if(money < BETS[0])
iLen = formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_NO_MONEY", money);
else
iLen = formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_HAVE_MONEY", money);

for(new i = 0, n = min(9, sizeof BETS); i < n; i++)
{
if(money < BETS[i])
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r%d. \d%d$^n", i + 1, BETS[i]);
else
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r%d. \w%d$^n", i + 1, BETS[i]);
keys |= (1 << i);
}
}
formatex(menu[iLen], charsmax(menu) - iLen, "^n\r0. \w%L^n", LANG_PLAYER, "EXIT");
keys |= (1 << 9);

show_menu(id, keys, menu, -1, "Lottery menu");
}
return PLUGIN_HANDLED;
}

public LotteryMenu_handler(id, key)
{
if(key == 9)
return PLUGIN_HANDLED;

new bet;

if(BETS[key] <= cs_get_user_money(id))
{
bet = BETS[key];
lottery_main(id, bet);

g_NowUsed[id] = get_systime();
}
else LotteryMenu(id);

return PLUGIN_HANDLED;
}

public lottery_main(id, bet)
{
new reward, WinnerName[MAX_NAME_LENGTH];
new money = cs_get_user_money(id);
new award = random_num(1, 100);
new pointer_cvar_money = get_cvar_pointer("mp_maxmoney");
new num_cvar_money = get_pcvar_num(pointer_cvar_money);

get_user_name(id, WinnerName, charsmax(WinnerName));

if(award < 81)
{
client_print_color(id, print_team_default, "^3[^4%L^3] %L", LANG_PLAYER, "TAG", LANG_PLAYER, "LOSE");

cs_set_user_money(id, money - bet, 1);
g_Jackpot += bet;

if(g_Jackpot > num_cvar_money)
g_Jackpot = num_cvar_money;
}
if(award >= 81 && award < 92)
{
reward = bet * 2;
if(bet > g_Jackpot || reward > g_Jackpot)
{
client_print_color(id, print_team_default, "^3[^4%L^3] %L", LANG_PLAYER, "TAG", LANG_PLAYER, "LOSE");

cs_set_user_money(id, money - bet, 1);
g_Jackpot += bet;

if(g_Jackpot > num_cvar_money)
g_Jackpot = num_cvar_money;
}
else
{
g_Jackpot -= reward;
client_print_color(id, print_team_default, "^3[^4%L^3] %L", LANG_PLAYER, "TAG", LANG_PLAYER, "WIN", reward);
cs_set_user_money(id, money + reward, 1);

new check_money = cs_get_user_money(id);

if(check_money > num_cvar_money)
cs_set_user_money(id, num_cvar_money, 0);

#if defined WIN_SOUND
emit_sound(id, CHAN_AUTO, "adv_lottery/win_simple.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
#endif
}
}
if(award >= 92 && award < 98)
{
reward = bet * 3;
if(bet > g_Jackpot || reward > g_Jackpot)
{
client_print_color(id, print_team_default, "^3[^4%L^3] %L", LANG_PLAYER, "TAG", LANG_PLAYER, "LOSE");
cs_set_user_money(id, money - bet, 1);
g_Jackpot += bet;

if(g_Jackpot > num_cvar_money)
g_Jackpot = num_cvar_money;
}
else
{
g_Jackpot -= reward;
client_print_color(id, print_team_default, "^3[^4%L^3] %L", LANG_PLAYER, "TAG", LANG_PLAYER, "WIN", reward);
cs_set_user_money(id, money + reward, 1);

new check_money = cs_get_user_money(id);

if(check_money > num_cvar_money)
cs_set_user_money(id, num_cvar_money, 0);

#if defined WIN_SOUND
emit_sound(id, CHAN_AUTO, "adv_lottery/win_simple.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
#endif
}
}
if(award >= 98)
{
client_print_color(0, print_team_default, "^3[^4%L^3] ^4%s ^3%L", LANG_PLAYER, "TAG", WinnerName, LANG_PLAYER, "WINNER_JACKPOT", g_Jackpot);

set_hudmessage(255, 255, 255, -0.97, -0.68, 0, 0.0, 2.2, 0.0, 0.2, -1);
ShowSyncHudMsg(0, g_SyncHud, "%s %L %d$!", WinnerName, LANG_PLAYER, "WINNER_HUD", g_Jackpot);

cs_set_user_money(id, money + g_Jackpot, 1);
new check_money = cs_get_user_money(id);

if(check_money > num_cvar_money)
cs_set_user_money(id, num_cvar_money, 0);

#if defined WIN_SOUND
emit_sound(0, CHAN_AUTO, "adv_lottery/win_jackpot.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
#endif
g_Jackpot = 0;
}
#if !defined INFORMER_HUD
set_hudmessage(255, 255, 255, -0.97, -0.70, 0, 0.0, 1.7, 0.0, 0.2, -1);
ShowSyncHudMsg(0, g_SyncHud, "%L %d$", LANG_PLAYER, "CURRENT", g_Jackpot);
#endif
}

public informer(id)
{
set_hudmessage(255, 255, 255, -0.97, -0.70, 0, 0.0, 1.5, 0.0, 0.0, -1);
ShowSyncHudMsg(0, g_SyncHud, "%L %d$", LANG_PLAYER, "CURRENT", g_Jackpot);
}

#if defined ROUND
public game_start()
g_Round = 0;

public round_start()
g_Round++;
#endif

#if defined SAVE
public plugin_end()
{
new Jackpot[10];
formatex(Jackpot, charsmax(Jackpot), "%d", g_Jackpot);
nvault_set(g_Save, "999", Jackpot), nvault_close(g_Save);
}
#endif
.
 
В этой теме было размещено решение! Перейти к решению.

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

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