Не ставится ставка Sf_Bets

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
102
Реакции
-1
Ошибка
Не ставится ставка Sf_Bets
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0-dev+5210
Билд
ReHLDS version: 3.11.0.776-dev
ReGamedll
ReGameDLL version: 5.21.0.546-dev
Версия Metamod
Metamod v1.21p37 2013/05/30 (5:13)
Список метамодулей
[ 1] Reunion RUN - reunion_mm_i386. v0.1.92d ini Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0-d ini Start ANY
[ 3] Rechecker RUN - rechecker_mm_i38 v2.3 ini Chlvl ANY
[ 4] WHBlocker RUN - whblocker_mm_i38 v1.5.692 ini Chlvl ANY
[ 5] Revoice RUN - revoice_mm_i386. v0.1.0.3 ini Start Never
[ 6] Ultimate Unprec RUN - unprecacher_i386 vBeta 2. ini Chlvl Chlvl
[ 7] ReAPI RUN - reapi_amxx_i386. v5.21.0. pl2 ANY Never
[ 8] gRIP RUN - grip_amxx_i386.s v0.1.5 B pl2 ANY ANY
[ 9] CStrike RUN - cstrike_amxx_i38 v1.9.0-d pl2 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0-d pl2 ANY ANY
[11] Ham Sandwich RUN - hamsandwich_amxx v1.9.0-d pl2 ANY ANY
[12] MySQL RUN - mysql_amxx_i386. v1.9.0-d pl2 ANY ANY
[13] Engine RUN - engine_amxx_i386 v1.9.0-d pl2 ANY ANY
[14] Fun RUN - fun_amxx_i386.so v1.9.0-d pl2 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.9.0-d pl2 ANY ANY
15 plugins, 15 running
Список плагинов
[ 1] Frags Counter 1.0 CHEL74 frags_counter.a running
[ 2] Time Bonus 1.1 SKOBAR1K time_bonus.amxx running
[ 3] Advanced Lottery 1.1.0 NordicWarrior advanced_lotter running
[ 4] Homicide statistics 1.0 OverGame hs.amxx running
[ 5] Music Connection 1.0.0 Jumper Music_Connectio running
[ 6] VIP System (exclusive 2.3.0 Emma Jule vip_system.amxx running
[ 7] Custom Player Models A 0.2.1 F@nt0M & BlackSi custom_player_m running
[ 8] Custom Player Models T 0.2.1 BlackSignature custom_player_m running
[ 9] Custom Player Models C 0.2.2 BlackSignature custom_player_m running
[ 10] [GM] Night VIP 1.1.1 [GM] NWC gm_night_vips.a running
[ 11] [ReAPI] Healthnade 0.0.4f F@nt0M + mx?! reapi_healthnad running
[ 12] FreshBans 1.4.0b kanagava fresh_bans.amxx running
[ 13] Telegram MSG 1.2.0 ex3m777 Telegam_sender. running
[ 14] [RS] Auto-Demo Recorde 1.0.2 vk/felhalas RS_DemoRecord.a running
[ 15] All Death Beams 0.9 SpaceDude all_death_beams running
[ 16] Admin Loader 2.9 neygomon admin_loader.am running
[ 17] Mode 2x2 1.9 s1lent mode.amxx running
[ 18] SF Bets 0.1.5 serfreeman1337 sf_bets.amxx running
[ 19] GameCMS_MapManager 1.1 zhorzh78 gamecms_mapmana running
[ 20] say /adminka 1.1 Pa1n say_adminka.amx running
[ 21] Check Admin & Vip 2.2 Leo_[BH] check_admin_vip running
[ 22] Change Team 1.1 neygomon changeteam.amxx running
[ 23] Unlimited ChooseTeam ( 1.0 ConnorMcLeod & p unlimited_choos running
[ 24] SF Warn Menu 0.1.4g serfreeman1337 sf_admin_warns. running
[ 25] Steam Bonus 2.0 Neugomon steambonus.amxx running
[ 26] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 27] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 28] InfoConnects 1.0 PAffAEJIkA :3 InfoConnects.am running
[ 29] AntiFlash FINAL 5.0 Leo_[BH] antiflash5.amxx running
[ 30] AWPoff 1.2 PAffAEJIkA :3 awp_off.amxx running
[ 31] CSGO Grafiti Plugin 2.0 Fatih ~ EjderYa CSGO_Graffiti_P running
[ 32] Scope Alert 1.1 Kriminal ScopeAlert.amxx running
[ 33] Меню Диджея 1.1 101FPS menu_didjeya.am running
[ 34] Killa HP 1.6 jas0n killa_hp.amxx running
[ 35] Team Grenade Trail 1.2 Numb team_grenade_tr running
[ 36] VIP Menu [CS RAIN] 0.15 Leo_[BH] vip_girl.amxx running
[ 37] Advanced Kill Assists 1.2 Xelson next21_kill_ass running
[ 38] AMXX Gag 1.5.0 xPaw & Exolent ( amx_gag.amxx running
[ 39] Connect users 0.1 neugomon.ru, Rem connect_users.a running
[ 40] Knives Menu 0.1 Subb98 knifes_menu.amx running
[ 41] FreeAmmoEveryRound 0.1 SHLAKBAUM freeammoeveryro running
[ 42] Furien Score & Round 0.2.1 Askhanar Score.amxx running
[ 43] Silly C4 1.1 Cheap_Suit sillyc4.amxx running
[ 44] WarmUP Pro 5.6 Beta ReymonARG warmuppro.amxx running
[ 45] mute menu 1.0 cheap_suit Mute_Menu.amxx running
[ 46] Block cheat key 1.1 9 rpamm!? block_key.amxx running
[ 47] Custom Smoke 1.07 bionext custom_smoke_bl running
[ 48] Automatic knife duel 0.3x JGHG / Leo_[BH] knf_duel.amxx running
[ 49] Info Rank 0.2 maFFyoZZyk info_rank.amxx running
[ 50] Back Weapons 1.87 hoboman313/cheap backweapons.amx running
[ 51] Autoresponder/Advertis 0.5 MaximusBrood ad_manager.amxx running
[ 52] [Customizable] AmxModM 0.0.4 Albertio amxmodmenu.amxx running
[ 53] AFK Manager 1.2 Xramer afk_manager.amx running
[ 54] Lite VoteBan 1.4 neygomon lite_voteban.am running
[ 55] Admin Spectator ESP 1.3 KoST admin_spec_esp. running
[ 56] Killing Particles 1.01 metallicawOw KP_FIX.amxx running
[ 57] Time Lights 1.1 Leo_[BH] time_light.amxx running
[ 58] unknown unknown unknown render.amxx running
[ 59] c4 timer 1.1 cheap_suit c4timer.amxx running
[ 60] Server Menu [INI] 1.0 server_menu.amx running
[ 61] ResetScore 1.0 Leo_[BH] resetscore_reap running
[ 62] unknown unknown unknown transfer.amxx running
[ 63] CS Revo: Camera New 1.0 Nani | Wilian M. csrevo_camera_n running
[ 64] HATS 0.2 SgtBane Hats02.amxx running
[ 65] Damager 1.0 Prayer damager.amxx running
[ 66] ReParachute 1.0 PurposeLess reparachute.amx running
[ 67] anti block 0.1 cheap_suit zp_antiblock.am running
[ 68] Admin Commands 1.9.0-dev+ AMXX Dev Team admincmd.amxx running
[ 69] Slots Reservation 1.9.0-dev+ AMXX Dev Team adminslots.amxx running
[ 70] Menus Front-End 1.9.0-dev+ AMXX Dev Team menufront.amxx running
[ 71] Commands Menu 1.9.0-dev+ AMXX Dev Team cmdmenu.amxx running
[ 72] Players Menu 1.7 neugomon players_menu.am running
[ 73] Maps Menu 1.9.0-dev+ AMXX Dev Team mapsmenu.amxx running
[ 74] Plugin Menu 1.9.0-dev+ AMXX Dev Team pluginmenu.amxx running
[ 75] Admin Chat 1.9.0-dev+ AMXX Dev Team adminchat.amxx running
[ 76] Anti Flood 1.9.0-dev+ AMXX Dev Team antiflood.amxx running
[ 77] Scrolling Message 1.9.0-dev+ AMXX Dev Team scrollmsg.amxx running
[ 78] Info. Messages 1.9.0-dev+ AMXX Dev Team imessage.amxx running
[ 79] Admin Votes 1.9.0-dev+ AMXX Dev Team adminvote.amxx running
[ 80] NextMap 1.9.0-dev+ AMXX Dev Team nextmap.amxx running
[ 81] TimeLeft 1.8.2 AMXX Dev Team timeleft_rus.am running
[ 82] Pause Plugins 1.9.0-dev+ AMXX Dev Team pausecfg.amxx running
[ 83] Restrict Weapons 1.9.0-dev+ AMXX Dev Team restmenu.amxx running
[ 84] CS Misc. Stats 1.9.0-dev+ AMXX Dev Team miscstats.amxx running
[ 85] CS Stats Logging 1.9.0-dev+ AMXX Dev Team stats_logging.a running
[ 86] AES: Bonus CSTRIKE 0.5.9 [REA serfreeman1337/s aes_bonus_cstri running
[ 87] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 88] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 89] AES Bonus: Flags 0.2 Sonyx aes_bonus_flags running
[ 90] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 91] AES: Status Info 0.1 serfreeman1337 aes_status_info running
[ 92] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 93] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 94] AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_cstr running
[ 95] CSStatsX SQL 0.7.4+1 serfreeman1337 csstatsx_sql.am running
[ 96] Stats Configuration 1.9.0-dev+ AMXX Dev Team statscfg.amxx running
96 plugins, 96 running
Автор плагина
serfreeman1337
Версия плагина
v. 0.1.5
Исходный код
/*
* SF Bets v. 0.1.5
* by serfreeman1337 http://1337.uz/
*/

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "SF Bets"
#define VERSION "0.1.5"
#define AUTHOR "serfreeman1337"

#define AES // раскомментируйте для возможности ставить опыт AES (http://1337.uz/advanced-experience-system/)
//#define ACP // раскомментируйте для возможности ставить очки ACP (http://www.a114games.com/community/threads/igrovye-akkaunty-ili-sistema-registracii-nikov.1658/)

#if defined AES
#include <aes_main>
#endif

#if defined ACP
#include <acp>

/*acp_get_player_auth(id)
return 1

acp_get_player_points(id)
return 1337*/

acp_take_player_points(id,points)
{
if(callfunc_begin("TakePoints","acp_general.amxx"))
{
callfunc_push_int(id)
callfunc_push_int(points)
callfunc_end()
}
}

acp_give_player_points(id,points)
{
if(callfunc_begin("GivePoints","acp_general.amxx"))
{
callfunc_push_int(id)
callfunc_push_int(points)
callfunc_end()
}
}
#endif

#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

#define MAX_PLAYERS 32
#define MAX_NAME_LENGTH 32

#define argbreak strbreak
#endif

// данный код не рекомендуется смотреть людям страдающим синдромом оптимизации

// -- КОНСТАНТЫ -- //

enum _:players_data_struct
{
BET_FOR, // на кого поставил игрок
BET_MONEY // деньги

#if defined AES
,BET_EXP,
BET_BONUS
#endif

#if defined ACP
,BET_POINTS
#endif
}

enum _:cvars
{
CVAR_MIN_PLAYERS,
CVAR_BET_TIME,
CVAR_BET_AUTOOPEN,
CVAR_BET_MONEY,
CVAR_BET_MODE,
CVAR_BET_MULTIPLER

#if defined AES
,CVAR_BET_EXP,
CVAR_BET_BONUS
#endif

#if defined ACP
,CVAR_BET_POINTS
#endif
}

const taskid_updatemenu = 31337

new const lyl_array[][] = {
{CVAR_BET_MONEY,BET_MONEY}
#if defined AES
,{CVAR_BET_EXP,BET_EXP}
,{CVAR_BET_BONUS,BET_BONUS}
#else
,{-1,-1}
,{-1,-1}
#endif
#if defined ACP
,{CVAR_BET_POINTS,BET_POINTS}
#else
,{-1,-1}
#endif
}

#define m_iJoinedState 121

// -- ПЕРЕМЕННЫЕ -- //

new t_id,ct_id // id игроков 1х1
new Float:bet_time // время ставки
new bet_menu

new players_data[MAX_PLAYERS + 1][players_data_struct]

new cvar[cvars]

new HamHook:hook_playerKilled
new menuCB_bet

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

// sf plugin tracker
register_cvar("sf_bets", VERSION, FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED)

hook_playerKilled = RegisterHam(Ham_Killed,"player","HamHook_PlayerKilled",true)
register_logevent("Bet_CheckMinPlayers",3,"1=joined team")
register_event("SendAudio", "EventHook_TWin", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "EventHook_CtWin", "a", "2&%!MRAD_ctwin")
register_event("HLTV", "EventHook_NewRound", "a", "1=0", "2=0")

//
// Минимальное количество игроков в обеих командах для работы ставок
//
cvar[CVAR_MIN_PLAYERS] = register_cvar("sf_bet_min_players","2")

//
// Время, в течении которого можно сделать ставку
//
cvar[CVAR_BET_TIME] = register_cvar("sf_bet_time","15")

//
// Ставка денег
//
cvar[CVAR_BET_MONEY] = register_cvar("sf_bet_money","100 1000 3000")

//
// Как расчитывается выигрыш
// 0 - выигрышем является сумма поставленная на проигравшего, делится в процентом соотношении ставки победителей
// 1 - выигрышем является ваша ставка
//
cvar[CVAR_BET_MODE] = register_cvar("sf_bet_mode","0")

//
// Множитель выигрыша
//
cvar[CVAR_BET_MULTIPLER] = register_cvar("sf_bet_multipler","1.0")

#if defined AES
//
// Ставка опыта
//
cvar[CVAR_BET_EXP] = register_cvar("sf_bet_exp","50 75 100")

//
// Ставка бонусов
//
cvar[CVAR_BET_BONUS] = register_cvar("sf_bet_bonus","")
#endif

#if defined ACP
//
// Ставка очков ACP
//
cvar[CVAR_BET_POINTS] = register_cvar("sf_bet_points","")
#endif

//
// Автоматическое открытие меню ставок
//
cvar[CVAR_BET_AUTOOPEN] = register_cvar("sf_bet_auto","1")

register_clcmd("say /bet","Bet_ShowMenu",-1,"- open bet menu")

register_dictionary("sf_bets.txt")
register_dictionary("common.txt")
}

public plugin_cfg()
{
server_exec()

// --- МЕНЮ --- //

bet_menu = menu_create("Bet Menu","Bet_MenuHandler")
menuCB_bet = menu_makecallback("Bet_MenuCallback")

menu_additem(bet_menu,"Player T","0",.callback = menuCB_bet)
menu_additem(bet_menu,"Player CT","1",.callback = menuCB_bet)

new v_cvar[10]
get_pcvar_string(cvar[CVAR_BET_MONEY],v_cvar,charsmax(v_cvar))

if(v_cvar[0])
menu_additem(bet_menu,"Money","2",.callback = menuCB_bet)

#if defined AES
get_pcvar_string(cvar[CVAR_BET_EXP],v_cvar,charsmax(v_cvar))

if(v_cvar[0])
menu_additem(bet_menu,"Exp","3",.callback = menuCB_bet)

get_pcvar_string(cvar[CVAR_BET_BONUS],v_cvar,charsmax(v_cvar))

if(v_cvar[0])
menu_additem(bet_menu,"Bonus","4",.callback = menuCB_bet)
#endif

#if defined ACP
get_pcvar_string(cvar[CVAR_BET_POINTS],v_cvar,charsmax(v_cvar))

if(v_cvar[0])
menu_additem(bet_menu,"Points","5",.callback = menuCB_bet)
#endif
}


public client_disconnect(id)
{
// TODO: придумать что-то
set_task(0.1,"Bet_CheckMinPlayers")

if(players_data[id][BET_FOR])
{
#if defined AES
if(players_data[id][BET_EXP])
{
aes_add_player_exp(id,-players_data[id][BET_EXP],true)
}

if(players_data[id][BET_BONUS])
{
aes_add_player_bonus(id,-players_data[id][BET_BONUS])
}
#endif

#if defined ACP
if(players_data[id][BET_POINTS])
{
acp_take_player_points(id,players_data[id][BET_POINTS])
}
#endif
}

arrayset(players_data[id],0,players_data_struct)
}

//
// Победа T
//
public EventHook_TWin()
{
if(t_id && ct_id)
Bet_End1x1(t_id)
}

//
// Победа CT
//
public EventHook_CtWin()
{
if(t_id && ct_id)
Bet_End1x1(ct_id)
}

public EventHook_NewRound()
{
if(t_id || ct_id)
{
new players[MAX_PLAYERS],pnum
get_players(players,pnum,"ch")

for(new i ; i < pnum ; i++)
{
arrayset(players_data[players[i]],0,players_data_struct)
}

t_id = 0
ct_id = 0
bet_time = 0.0
}
}

//
// Вкл/выкл обнаружения 1x1 по кол-ву игроков в командах
//
public Bet_CheckMinPlayers()
{
new players[MAX_PLAYERS],pnum,min_players = get_pcvar_num(cvar[CVAR_MIN_PLAYERS])

// проверяем кол-во игроков за T
get_players(players,pnum,"e","TERRORIST")

if(pnum < min_players)
{
DisableHamForward(hook_playerKilled)
return PLUGIN_CONTINUE
}

// проверяем кол-во игроков за CT
get_players(players,pnum,"e","CT")

if(pnum < min_players)
{
DisableHamForward(hook_playerKilled)
return PLUGIN_CONTINUE
}

// вкл все

if(Bet_Check1x1())
{
Bet_Start()
}

EnableHamForward(hook_playerKilled)
return PLUGIN_CONTINUE
}

public HamHook_PlayerKilled()
{
if(Bet_Check1x1())
{
Bet_Start()
}
}

//
// Начало 1х1
//
public Bet_Start()
{
bet_time = get_gametime() + get_pcvar_float(cvar[CVAR_BET_TIME])

// показываем меню всем
if(get_pcvar_num(cvar[CVAR_BET_AUTOOPEN]))
{
new players[MAX_PLAYERS],pnum
get_players(players,pnum,"ch")

for(new i,player ; i < pnum ; i++)
{
player = players[i]

Bet_ShowMenu(player)
}
}

// таск обновление меню игрокам
if(!task_exists(taskid_updatemenu))
set_task(0.5,"Bet_UpdateMenu",taskid_updatemenu,.flags = "b")
}

//
// Конец 1x1
//
public Bet_End1x1(win_practicant)
{
new players[MAX_PLAYERS],pnum
get_players(players,pnum,"ch")

bet_time = 0.0
remove_task(taskid_updatemenu)
Bet_UpdateMenu()

for(new i,player ; i < pnum ; i++)
{
player = players[i]

// игрок не делал ставку
if(!players_data[player][BET_FOR])
{
continue
}

// победная ставка
if(players_data[player][BET_FOR] == win_practicant)
{
new win_name[MAX_NAME_LENGTH]
get_user_name(players_data[player][BET_FOR],win_name,charsmax(win_name))

new prize,prize_str[128],prize_len

prize = Bet_GetWinPool(player,BET_MONEY,win_practicant)

// выдаем деньги
if(prize)
{
prize_len += formatex(prize_str[prize_len],charsmax(prize_str) - prize_len,"%L",
player,"SF_BET14",
prize
)

cs_set_user_money(player,
cs_get_user_money(player) + prize
)
}

#if defined AES
// выдаем опыт
prize = Bet_GetWinPool(player,BET_EXP,win_practicant)

if(prize)
{
prize_len += formatex(prize_str[prize_len],charsmax(prize_str) - prize_len,"%s%L",
prize_len ? ", " : "",
player,"SF_BET15",
prize
)

aes_add_player_exp(player,prize)
}

// выдаем бонусы
prize = Bet_GetWinPool(player,BET_BONUS,win_practicant)

if(prize)
{
prize_len += formatex(prize_str[prize_len],charsmax(prize_str) - prize_len,"%s%L",
prize_len ? ", " : "",
player,"SF_BET21",
prize
)

aes_add_player_bonus(player,prize)
}
#endif

#if defined ACP
prize = Bet_GetWinPool(player,BET_POINTS,win_practicant)

if(prize)
{
prize_len += formatex(prize_str[prize_len],charsmax(prize_str) - prize_len,"%s%L",
prize_len ? ", " : "",
player,"SF_BET25",
prize
)

acp_give_player_points(player,prize)
}
#endif

if(!prize_len)
{
formatex(prize_str,charsmax(prize_str),"%L",player,"SF_BET22")
}

client_print_color(player,print_team_blue,"%L %L",
player,"SF_BET9",
player,"SF_BET13",
win_name,prize_str
)
}
// фейловая ставка
else
{
new lose_name[MAX_NAME_LENGTH]
get_user_name(players_data[player][BET_FOR],lose_name,charsmax(lose_name))

client_print_color(player,print_team_red,"%L %L",
player,"SF_BET9",
player,"SF_BET12",
lose_name
)

if(players_data[player][BET_MONEY])
{
cs_set_user_money(player,
cs_get_user_money(player) - players_data[player][BET_MONEY]
)
}

#if defined AES
if(players_data[player][BET_EXP])
{
aes_add_player_exp(player,-players_data[player][BET_EXP],true)
}

if(players_data[player][BET_BONUS])
{
aes_add_player_bonus(player,-players_data[player][BET_BONUS])
}
#endif

#if defined ACP
if(players_data[player][BET_POINTS])
{
acp_take_player_points(player,players_data[player][BET_POINTS])
}
#endif
}

arrayset(players_data[player],0,players_data_struct)
}
}

//
// Функция обновления меню игрокам
//
public Bet_UpdateMenu()
{
new players[MAX_PLAYERS],pnum
get_players(players,pnum,"ch")

new Float:bet_left = bet_time - get_gametime()

for(new i,player,menu,newmenu,menupage ; i < pnum ; i++)
{
player = players[i]

player_menu_info(player,menu,newmenu,menupage)

// обновляем меню ставок игроку
if(newmenu == bet_menu)
{
// обновляем меню
if(floatround(bet_left) > 0)
{
Bet_MenuFormat(player)
menu_display(player,bet_menu)
}
// закрываем меню по истечению времени
else
{
menu_cancel(player)
show_menu(player,0,"^n")
}
}
}

// сбрасываем такс
if(bet_left <= 0.0)
{
remove_task(taskid_updatemenu)
}
}

//
// Показываем меню ставок
//
public Bet_ShowMenu(id)
{
// hax
if(id == t_id || id == ct_id)
{
return PLUGIN_HANDLED
}

// не показываем меню игрокам в спектаторах
if(!(CS_TEAM_T <= cs_get_user_team(id) <= CS_TEAM_CT) || get_pdata_int(id,m_iJoinedState))
{
return PLUGIN_HANDLED
}

// меню можно вызвать только 1x1
if(!t_id || !ct_id)
{
client_print_color(id,print_team_red,"%L %L",
id,"SF_BET9",
id,"SF_BET10"
)

return PLUGIN_CONTINUE
}

if(players_data[id][BET_FOR])
{
client_print_color(id,print_team_red,"%L %L",
id,"SF_BET9",
id,"SF_BET18"
)

return PLUGIN_CONTINUE
}

// меню можно вызвать только живым
if(is_user_alive(id))
{
client_print_color(id,print_team_red,"%L %L",
id,"SF_BET9",
id,"SF_BET11"
)

return PLUGIN_CONTINUE
}

new Float:bet_left = bet_time - get_gametime()

if(bet_left <= 0.0)
{
client_print_color(id,print_team_red,"%L %L",
id,"SF_BET9",
id,"SF_BET17"
)

return PLUGIN_CONTINUE
}

Bet_MenuFormat(id)
menu_display(id,bet_menu)

return PLUGIN_CONTINUE

}

//
// Обработка действий в меню
//
public Bet_MenuHandler(id,menu,r_item)
{
if(r_item == MENU_EXIT)
{
return PLUGIN_HANDLED
}

new ri[2],di[2]
menu_item_getinfo(menu,r_item,di[0],ri,charsmax(ri),di,charsmax(di),di[0])

new item = str_to_num(ri)

switch(item)
{
// делаем ставки
case 0,1:
{
// ставим деньги
if(players_data[id][BET_MONEY])
{
new user_money = cs_get_user_money(id)

// игроку не хватает денег
if(user_money < players_data[id][BET_MONEY])
{
Bet_MenuFormat(id)
menu_display(id,menu)

return PLUGIN_HANDLED
}
}

#if defined AES
new rt[AES_ST_END]
aes_get_player_stats(id,rt)

// ставим опыт

if(players_data[id][BET_EXP])
{
if(rt[AES_ST_EXP] < players_data[id][BET_EXP])
{
Bet_MenuFormat(id)
menu_display(id,menu)

return PLUGIN_HANDLED
}
}

if(players_data[id][BET_BONUS])
{
if(rt[AES_ST_BONUSES] < players_data[id][BET_BONUS])
{
Bet_MenuFormat(id)
menu_display(id,menu)

return PLUGIN_HANDLED
}
}
#endif

#if defined ACP
if(players_data[id][BET_POINTS])
{
if(acp_get_player_points(id) < players_data[id][BET_POINTS])
{
Bet_MenuFormat(id)
menu_display(id,menu)

return PLUGIN_HANDLED
}
}
#endif

// запоминаем на кого поставили
players_data[id][BET_FOR] = item == 0 ? t_id : ct_id

if(!players_data[id][BET_FOR])
{
return PLUGIN_HANDLED
}

// сообщение в чат
new plr_name[MAX_NAME_LENGTH],bet_name[MAX_NAME_LENGTH]

get_user_name(id,plr_name,charsmax(plr_name))
get_user_name(players_data[id][BET_FOR],bet_name,charsmax(bet_name))

// сообщение всем мертвым игрокам
new players[MAX_PLAYERS],pnum
get_players(players,pnum,"bch")

for(new i,player ; i < pnum ; i++)
{
player = players[i]

if(player == id)
{
client_print_color(player,
print_team_default,
"%L %L",
player,"SF_BET9",
player,"SF_BET27",
bet_name
)
}
else
{
client_print_color(player,
(cs_get_user_team(player) == CS_TEAM_CT ? print_team_blue : print_team_red), // красим ник в цвет команды
"%L %L",
player,"SF_BET9",
player,"SF_BET28",
plr_name,bet_name
)
}

}
}
// переключатели стаовк
case 2,3,4,5:
{
new cp = lyl_array[item - 2][0]
new sp = lyl_array[item - 2][1]

new bet_str[128],bet_val[10],bool:set
get_pcvar_string(cvar[cp],bet_str,charsmax(bet_str))

while(argbreak(bet_str,
bet_val,charsmax(bet_val),
bet_str,charsmax(bet_str)) != -1
)
{
if(!bet_val[0])
break

bet_val[0] = str_to_num(bet_val)

// переключаем на большее значение
if(bet_val[0] > players_data[id][sp])
{
set = true
players_data[id][sp] = bet_val[0]
break
}
}

// сбрасываем переключатель
if(bet_val[0] <= players_data[id][sp] && !set)
{
players_data[id][sp] = 0
}

switch(item)
{
case 2:
{
if(cs_get_user_money(id) < players_data[id][sp])
{
players_data[id][sp] = 0
}
}
#if defined AES
case 3,4:
{
new rt[AES_ST_END]
aes_get_player_stats(id,rt)

if(
(item == 3 && rt[AES_ST_EXP] < players_data[id][sp])
||
(item == 4 && rt[AES_ST_BONUSES] < players_data[id][sp])
)
{
players_data[id][sp] = 0
}
}
#endif
#if defined ACP
case 5:
{
if(acp_get_player_points(id) < players_data[id][sp])
{
players_data[id][sp] = 0
}
}
#endif
}

Bet_MenuFormat(id)
menu_display(id,menu)
}
}

return PLUGIN_HANDLED
}
Здраствуйте, кто может подсказать в чем проблема?
В меню ставок Опыт высвечивается, но ставку сделать не возможно. Кроме 0 ничего не пишет
 
Сообщения
3,593
Реакции
1,576
Помог
141 раз(а)
Приложите конфиг
 
Сообщения
194
Реакции
43
Помог
4 раз(а)
версия AES плагина старая там просто вот и не работает тебе надо под новую сделать
 
Сообщения
775
Реакции
293
Помог
11 раз(а)
Benzogang_BabyTape ,ды нет ошибок, сегодня тоже заметил, ставку выбрать могу, а вот поставить не могу...
 
Сообщения
893
Реакции
149
Помог
25 раз(а)
maFFyoZZyk, как вариант, выводить в чат сообщения при ставке, что бы смотреть, срабатывает ли вообще нужный код, и таким методом искать, где сообщение не выводит.
 
Сообщения
775
Реакции
293
Помог
11 раз(а)
Benzogang_BabyTape, нашел проблему, старый был инклюд.
протестировал на ботах, вроде все работает. (правда имена не отиображает, может потому что это боты, а может потому что на скорую руку)
Убрал поддержку аср потому как она загнулась
 

Вложения

Сообщения
775
Реакции
293
Помог
11 раз(а)
P.s. это ланг у меня был кривой, данная версия полностью рабочая
 
Статус
В этой теме нельзя размещать новые ответы.

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

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