From d3e097ac4ed3ec47fb5fdd3bf753d0a10c7c9127 Mon Sep 17 00:00:00 2001 From: BaHeK Date: Mon, 6 Nov 2017 23:07:49 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D0=BD=D0=B5=20=D1=85=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B0=D0=B5=D1=82=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B8,=20=D0=B8=D0=B7-=D0=B7=D0=B0=20=D0=BA=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=BE=D0=B9=20=D0=BE=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B8=D1=81=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D1=82=20=D0=B2=D0=BE=20=D0=B2=D1=81=D0=B5=D1=85=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B6=D0=B8=D0=BC=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deathrun_mode_skillmaster.sma | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deathrun_mode_skillmaster.sma b/deathrun_mode_skillmaster.sma index 811cb71..dab9e68 100644 --- a/deathrun_mode_skillmaster.sma +++ b/deathrun_mode_skillmaster.sma @@ -122,7 +122,7 @@ public dr_chosen_new_terrorist(id) } public Ham_PlayerPreThink_Pre(id) { - if(id != g_iTerrorist || !is_user_alive(id)) return HAM_IGNORED; + if(g_iCurMode != g_iModeSkillMaster || id != g_iTerrorist || !is_user_alive(id)) return HAM_IGNORED; new buttons = pev(id, pev_button); new oldbuttons = pev(id, pev_oldbuttons); From 0f2f7875fee19d764f3f797865270b026ed7788f Mon Sep 17 00:00:00 2001 From: BaHeK Date: Mon, 6 Nov 2017 23:13:52 +0300 Subject: [PATCH 2/3] =?UTF-8?q?CanBuyItem:=20forward=20->=20callfunc\n?= =?UTF-8?q?=D0=B5=D1=81=D0=BB=D0=B8=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20callfunc,=20=D1=82=D0=BE?= =?UTF-8?q?=20=D1=83=20=D0=B2=D1=81=D0=B5=D1=85=20=D0=BF=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B2=20=D0=B2=20=D0=BC=D0=B0=D0=B3?= =?UTF-8?q?=D0=B0=D0=B7=D0=B8=D0=BD=D0=B5=20=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE?= =?UTF-8?q?=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D1=81=20=D0=BE=D0=B4=D0=B8=D0=BD=D0=B0=D0=BA=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D0=BC=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deathrun_shop.sma | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/deathrun_shop.sma b/deathrun_shop.sma index 3168562..a774191 100644 --- a/deathrun_shop.sma +++ b/deathrun_shop.sma @@ -81,7 +81,7 @@ public native_add_item(plugin, params) if(function[0]) { // public CanBuyItem(id); - eItemInfo[ItemCanBuy] = CreateMultiForward(function, ET_CONTINUE, FP_CELL); + eItemInfo[ItemCanBuy] = get_func_id(function, plugin); } ArrayPushArray(g_aShopItems, eItemInfo); @@ -144,7 +144,7 @@ Show_ShopMenu(id, page) if(~eItemInfo[ItemTeam] & team) continue; szNum[0] = i; - hCallback = (GetCanBuyAnswer(id, eItemInfo[ItemCanBuy]) == ITEM_ENABLED) ? -1 : g_hCallbackDisabled; + hCallback = (GetCanBuyAnswer(id, eItemInfo[ItemPlugin], eItemInfo[ItemCanBuy]) == ITEM_ENABLED) ? -1 : g_hCallbackDisabled; formatex(szText, charsmax(szText), "%s %s \R\y$%d", eItemInfo[ItemName], g_szItemAddition, eItemInfo[ItemCost]); menu_additem(menu, szText, szNum, eItemInfo[ItemAccess], hCallback); @@ -176,7 +176,7 @@ public ShopMenu_Handler(id, menu, item) new team = (1 << _:cs_get_user_team(id)); - if((~eItemInfo[ItemTeam] & team) || GetCanBuyAnswer(id, eItemInfo[ItemCanBuy]) != ITEM_ENABLED) + if((~eItemInfo[ItemTeam] & team) || GetCanBuyAnswer(id, eItemInfo[ItemPlugin], eItemInfo[ItemCanBuy]) != ITEM_ENABLED) { client_print_color(id, print_team_default, "%s^1 %L", PREFIX, id, "DRS_CANT_BUY"); return PLUGIN_HANDLED; @@ -201,10 +201,12 @@ public ShopMenu_Handler(id, menu, item) Show_ShopMenu(id, item / 7); return PLUGIN_HANDLED; } -GetCanBuyAnswer(id, callback) +GetCanBuyAnswer(id, plugin, callback) { if(!callback) return ITEM_ENABLED; - new return_value; ExecuteForward(callback, return_value, id); + callfunc_begin_i(callback, plugin); + callfunc_push_int(id); + new return_value = callfunc_end(); return return_value; } public ShopDisableItem() From 488799c9435b44e9fb5062d39f8ac383a7f02a79 Mon Sep 17 00:00:00 2001 From: BaHeK Date: Mon, 6 Nov 2017 23:17:00 +0300 Subject: [PATCH 3/3] =?UTF-8?q?4=20=D0=BF=D1=80=D0=BE=D0=B1=D0=B5=D0=BB?= =?UTF-8?q?=D0=B0=20->=20=D1=82=D0=B0=D0=B1=20(=D0=B7=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=BB,=20=D0=BD=D0=B5=20=D0=BF=D0=BE=D1=81=D0=BC=D0=BE=D1=82?= =?UTF-8?q?=D1=80=D0=B5=D0=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deathrun_shop.sma | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deathrun_shop.sma b/deathrun_shop.sma index a774191..106dd7a 100644 --- a/deathrun_shop.sma +++ b/deathrun_shop.sma @@ -204,9 +204,9 @@ public ShopMenu_Handler(id, menu, item) GetCanBuyAnswer(id, plugin, callback) { if(!callback) return ITEM_ENABLED; - callfunc_begin_i(callback, plugin); - callfunc_push_int(id); - new return_value = callfunc_end(); + callfunc_begin_i(callback, plugin); + callfunc_push_int(id); + new return_value = callfunc_end(); return return_value; } public ShopDisableItem()