Plugin error - re_ct_bomb_cracker

Сообщения
290
Реакции
28
Помог
2 раз(а)
Ошибка
L 03/09/2021 - 16:46:50: Start of error session.
L 03/09/2021 - 16:46:50: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20210309.log")
L 03/09/2021 - 16:46:50: [ReAPI] SetHookChainReturn: trying to set return value with incompatible type, expected 'ATYPE_BOOL'; got 'ATYPE_INTEGER'
L 03/09/2021 - 16:46:50: [AMXX] Displaying debug trace (plugin "re_ct_bomb_cracker.amxx", version "0.0.4")
L 03/09/2021 - 16:46:50: [AMXX] Run time error 10: native error (native "SetHookChainReturn")
L 03/09/2021 - 16:46:50: [AMXX] [0] re_ct_bomb_cracker.sma::RoundEnd (line 151)
ОС
Linux
Amx Mod X
1.9.0 5271
Билд
version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.8.0.711-dev
Build date: 13:13:38 Feb 6 2021 (2492)
Build from: https://github.com/dreamstalker/rehlds/commit/722e19d
ReGamedll
game version
ReGameDLL version: 5.20.0.492-dev
Build date: 15:26:35 Jan 4 2021
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/aae507c
Версия Metamod
meta version
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
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.92d ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 4] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5271 ini Start ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 6] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 7] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 8] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl4 ANY ANY
[ 9] AuthEmu RUN - authemu_amxx_i386.so v5.2.12.425-dev pl4 ANY Never
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5271 pl4 ANY ANY
[11] MySQL RUN - mysql_amxx_i386.so v1.9.0.5271 pl4 ANY ANY
[12] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5271 pl4 ANY ANY
[13] ReAPI RUN - reapi_amxx_i386.so v5.19.0.211-dev pl4 ANY Never
[14] Engine RUN - engine_amxx_i386.so v1.9.0.5271 pl4 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5271 pl4 ANY ANY
[17] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl4 ANY Never
[18] SxGeo RUN - sxgeo_amxx_i386.so v2.3 pl4 ANY Never
[19] Fun RUN - fun_amxx_i386.so v1.9.0.5271 pl4 ANY ANY
19 plugins, 19 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] FreshBans 1.4.3b kanagava fresh_bans_143_ running
[ 2] WebHS 0.1 kanagava fb_web_online.a running
[ 3] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 4] Auto Join on Connect 0.1 VEN auto_join_on_co running
[ 5] [190] Cvar On Map 20.06.06 SKAJIbnEJIb cvar_on_map.amx running
[ 6] [SQL] Chat Manager 1.1.1-13 Mistrick chatmask.amxx running
[ 7] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 8] [ReAPI] Anti overflow 1.0 Some Author antioverflow.am running
[ 9] [190] Damager RBS 20.06.06 SKAJIbnEJIb damager_rbs.amx running
[ 10] Advanced Mute 2.1 OciXCrom crx_advmute.amx running
[ 11] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 12] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 13] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 14] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 15] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 16] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
[ 17] AES Bonus: Flags 0.2 Sonyx aes_bonus_flags running
[ 18] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 19] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am running
[ 20] Access Manager 1.0.0 mx?! AccessManager.a running
[ 21] Gag System 1.1 TheRedShoko @ AM gag_system.amxx running
[ 22] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 23] Lista admini (amx_who) cs.leaguec Kobra whobun.amxx running
[ 24] unknown unknown unknown flash.amxx running
[ 25] Team Transfer 2.1 UnFoRgIvEn transfer_chat.a running
[ 26] MOTD Commands 1.3 OciXCrom crx_motdcommand running
[ 27] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx running
[ 28] Commands Menu 1.9.0.5271 AMXX Dev Team cmdmenu.amxx running
[ 29] Menus Front-End 1.9.0.5271 AMXX Dev Team menufront.amxx running
[ 30] SHOW IP + LAST IP 2.0 Alka + x amx_showip_last running
[ 31] Players Menu 1.7 neugomon players_menu.am running
[ 32] Pause Plugins 1.9.0.5271 AMXX Dev Team pausecfg.amxx running
[ 33] Admin Help 1.9.0.5271 AMXX Dev Team adminhelp.amxx running
[ 34] Plugin Menu 1.9.0.5271 AMXX Dev Team pluginmenu.amxx running
[ 35] OciXCrom's Admin Chat 4.1.1 OciXCrom crx_adminchat.a running
[ 36] Private Message: Core 1.5 Denzer private_message running
[ 37] Private Message: Loggi 1.3 Denzer private_message running
[ 38] Items Restrict 1.1 s1lent items_restrict. running
[ 39] Server Menu 1.5.0 F@nt0M server_menu.amx running
[ 40] Advanced Spam Nick Cha 0.2 Fullserver advanced_spam_n running
[ 41] Multi-Lingual System 1.9.0.5271 AMXX Dev Team multilingual.am running
[ 42] Whatsapp_Group_Request 3.2 CrAzY MaN whatsapp_group_ running
[ 43] SERVER TASKS 2.0 HATTRICK (HTTRCK server_tasks.am running
[ 44] Stats Configuration 1.9.0.5271 AMXX Dev Team statscfg.amxx running
[ 45] unknown unknown unknown fake.amxx running
[ 46] CS AFK Manager 1.0.6 (amx Freeman afk_manager_1-8 running
[ 47] Fake Ping 1.1 MeRcyLeZZ/gyxoBk FakePing.amxx running
[ 48] Ultimele Harti 1.0 M@$t3r_@dy harti.amxx running
[ 49] CFG Slash 1.0 aNNakin cfg_slash.amxx running
[ 50] Fall Damage HP Restore 0.0.1 Vaqtincha FallDamageHpRes running
[ 51] WeaponState Remember 0.0.4 Vaqtincha weaponstate_rem running
[ 52] Admin Commands Log 1.2 w0w admin_commands_ running
[ 53] ResetScore 1.0 Leo_[BH] resetscore_reap running
[ 54] Reklama 09.07.2019 mx?! reklama.amxx running
[ 55] [190] Warmup RBS 20.08.08 SKAJIbnEJIb warmup_rbs.amxx running
[ 56] [190] Ultimate Flags 20.06.06 SKAJIbnEJIb ultimate_flags. running
[ 57] Slap/Slay Team 1.0 Kobra slaylslapteam.a running
[ 58] Invisible Spectator 1.0 ReHLDS Team invisible_spect running
[ 59] Check Vip 2.0 Leo_[BH] check.amxx running
[ 60] Map Manager: Core 3.0.7 Mistrick map_manager_cor running
[ 61] Map Manager: Scheduler 0.1.5 Mistrick map_manager_sch running
[ 62] Map Manager: Nominatio 0.1.2 Mistrick map_manager_nom running
[ 63] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 64] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 65] Map Manager: Effects 0.0.9 Mistrick map_manager_eff running
[ 66] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 67] Map Manager: Advanced 0.0.5 Mistrick map_manager_adv running
[ 68] Map Manager: Online ch 1.0.0 Sergey Shorokhov map_manager_onl running
[ 69] FocusOnVotemap 1.2.1 Boec[SpecOPs] focus_on_votema running
[ 70] Voiceserver Connect 1.1.015 Nextra voiceserver_con running
[ 71] Hide 1.1 xPaw hidexpaw.amxx running
[ 72] M_AntiRusher 2.83 Miczu xPaw_Antirusher running
[ 73] Say Me And HP 1.0 Javekson say_me_hp.amxx running
[ 74] [ReAPI] Info Killer 1.1.0 Jumper Info_Killer.amx running
[ 75] Save score & money 1.2.4 Minni Mouse Save_Score_and_ running
[ 76] Hostname Timeleft 1.0 xPaw HostnameTimelef running
[ 77] [ReAPI] Block 'Fire in 0.0.1 sergrib simpleblockfith running
[ 78] Admins Only 1.0 Andy staffonly.amxx running
[ 79] Team Grenade Trail 1.2 Numb team_grenade_tr running
[ 80] Write MS 0.1 ill log_ms.amxx running
[ 81] Advanced Kill Assists 1.3c Xelson next21_kill_ass running
[ 82] Top Awards 0.2cx Safety1st top_awards2.amx running
[ 83] [ReApi] Killer ScreenF 0.0.4 Vaqtincha reapi_killer_sc running
[ 84] [190] Snipers RBS 20.06.06 SKAJIbnEJIb snipers_rbs.amx running
[ 85] [ReAPI] Kills Counter 0.3 serfreeman1337 kills_counter.a running
[ 86] Online Logger 1.0.3 mx?! online_logger.a running
[ 87] Real Game Time 1.0 mx?! real_game_time. running
[ 88] DemoRecoder 1.1 neygomon amx_demorec.amx running
[ 89] Statsx Add-on 1.0.6 Radius statsx_addon.am running
[ 90] [SxGeo] Connect Info 1.0 s1lent sxgeo_connect_i running
[ 91] [ReAPI] VIP System 1.3.1 pUzzlik re_vip_system.a running
[ 92] mp_hostages_rescuetime 0.0.2 wopox1337 mp_hostages_res running
[ 93] [183] Real Hostages 17.08.20 Avalanche & SKAJ real_hostages.a running
[ 94] Bet 2.2 Filip Vilicic bet.amxx running
[ 95] [190] Stimulation RBS 20.06.06 SKAJIbnEJIb stimulation_rbs running
[ 96] Slay Losers 1.1.6 [email protected] slay_losers.amx running
[ 97] Quick and No Scope Det 1.2 EFFx QuickNoScopeD.a running
[ 98] Steam Bonus 1.1 ill+F@nToM steam_bonus_a2. running
[ 99] GSClient: Bonus Menu 1.0 Hypa_[KZ] gsclient_bonus_ running
99 plugins, 99 running
Автор плагина
Vaqtincha
Версия плагина
0.0.4
Исходный код
// Copyright © 2017 Vaqtincha

/**
* Credits:
*
* - s1lent - за проект ReGameDLL (и за sdk)
* - voed - за идею (плагина "CT Bomb Defusing")
*
*/

///■■■■■■■■■■■■■■■■■■■■■■■ CONFIG START ■■■■■■■■■■■■■■■■■■■■■■■//

#define DEFUSE_TIME 8 // Время разминирование в секундах (с щипцами 2 раза быстрее)
#define FIXING_TIME 5 // Время исправление бомбы в секундах (чтоб запретить просто закомментируйте)

#define BOMB_DETONATE_TIME 1 // Время взрыва после плента (0 = сразу)

#define BOMB_RADIUS 100 // Радиус взрыва. Закомментить если нужен дефолтный (по дефолту 500 юнитов)

#define BOMB_USE_SAMPLE "weapons/c4_disarmed.wav" // Закомментируйте, если не нужен
// #define CANT_ATTACK // Запретить атаку(ЛКМ) при дефузе/фиксе (как в оригинале)
#define CANT_RUN // Заморозка при при дефузе/фиксе (как в оригинале)


#define TEST_PRINT_CHAT // для тестов

///■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG END ■■■■■■■■■■■■■■■■■■■■■■■■//


#include <amxmodx>
#include <hamsandwich>
#include <reapi>

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif


#define PL_VERSION "0.0.4"

#define MAX_BOMB_RADIUS 2048.0


#define IsPlayer(%1) (1 <= %1 <= g_iMaxPlayers)
#define IsOnGround(%1) ((get_entvar(%1, var_flags) & FL_ONGROUND) == FL_ONGROUND)


new g_iMaxPlayers, g_iC4TimerOld, bot_deathmatch
#if defined CANT_RUN
new HookChain:g_hResetMaxSpeed
#endif
new HamHook:g_hBombThink

new g_pBombDefuser, g_pBombPlanter, g_pBombFixer
new bool:g_bStartDefuse, bool:g_bBombCracked, bool:g_bStartFix
new Float:g_flFixCountDown, Float:g_flNextFix, Float:g_flDefuseCountDown, Float:g_flNextDefuse

#if defined BOMB_RADIUS
new Float:g_flBombRadiusDefault
#endif

#if defined BOMB_USE_SAMPLE
public plugin_precache()
{
precache_sound(BOMB_USE_SAMPLE)
}
#endif

public plugin_init()
{
register_plugin("CT Bomb Cracker", PL_VERSION, "Vaqtincha")

if(!get_member_game(m_bMapHasBombTarget))
{
pause("ad")
return
}

register_logevent("LogEvent_BombPlanted", 3, "2=Planted_The_Bomb")

RegisterHam(Ham_ObjectCaps, "weaponbox", "CWeaponbox_ObjectCaps", .Post = false)
RegisterHam(Ham_Use, "weaponbox", "CWeaponbox_Use", .Post = false)
DisableHamForward(g_hBombThink = RegisterHam(Ham_Think, "weaponbox", "CWeaponbox_Think", .Post = false))
RegisterHam(Ham_Item_AddToPlayer, "weapon_c4", "CBasePlayerItem_AddToPlayer", .Post = true)

RegisterHookChain(RG_RoundEnd, "RoundEnd", .post = false)
RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound", .post = false)
#if defined CANT_RUN
DisableHookChain(g_hResetMaxSpeed = RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "CBasePlayer_ResetMaxSpeed", .post = false))
#endif
#if defined BOMB_RADIUS
g_flBombRadiusDefault = floatmin(Float:get_member_game(m_flBombRadius), MAX_BOMB_RADIUS)
#endif

bot_deathmatch = get_cvar_pointer("bot_deathmatch")
g_iMaxPlayers = get_maxplayers()
}

#if AMXX_VERSION_NUM < 183
public client_disconnect(pPlayer)
#else
public client_disconnected(pPlayer)
#endif
{
if(pPlayer == g_pBombDefuser) {
g_pBombDefuser = 0
}
else if(pPlayer == g_pBombPlanter) {
g_pBombPlanter = 0
}
else if(pPlayer == g_pBombFixer) {
g_pBombFixer = 0
}
}

public CSGameRules_RestartRound()
{
#if defined BOMB_RADIUS
if(g_flBombRadiusDefault > 0.0 && g_bBombCracked) {
set_member_game(m_flBombRadius, g_flBombRadiusDefault)
}
#endif

ForwardToggle(false)

g_bStartDefuse = g_bBombCracked = g_bStartFix = false
g_flDefuseCountDown = g_flNextDefuse = g_flFixCountDown = g_flNextFix = 0.0
g_pBombDefuser = g_pBombPlanter = g_pBombFixer = 0
}

public RoundEnd(const WinStatus:status, const ScenarioEventEndRound:event, const Float:tmDelay)
{
if(!g_bBombCracked) // || !g_pBombDefuser
return HC_CONTINUE

if(status == WINSTATUS_TERRORISTS && event == ROUND_TARGET_BOMB)
{
if(/* IsPlayer(g_pBombPlanter) && */ is_user_connected(g_pBombPlanter))
{
new Float:flFrags
get_entvar(g_pBombPlanter, var_frags, flFrags)
if(flFrags) {
set_entvar(g_pBombPlanter, var_frags, flFrags - 3.0)
}
}

rg_round_end(tmDelay, WINSTATUS_CTS, ROUND_BOMB_DEFUSED)
// set_member_game(m_iNumCTWins, get_member_game(m_iNumCTWins) + 1)
rg_update_teamscores(.iCtsWins = 1)

SetHookChainReturn(ATYPE_INTEGER, false)
return HC_SUPERCEDE
}

return HC_CONTINUE
}

public LogEvent_BombPlanted()
{
if(!g_bBombCracked) // || !g_pBombDefuser
return

g_pBombPlanter = get_loguser_index()
if(is_user_connected(g_pBombPlanter))
{
if(random(2) == 1)
client_print_color(g_pBombPlanter, print_team_default, "^4* ^1Dupa ^3%d ^1sec. tu explodezi.", BOMB_DETONATE_TIME)
else
client_print_color(g_pBombPlanter, print_team_default, "^4* ^1ai ^3%d ^1sec. sa-ti salvezi fundul.", BOMB_DETONATE_TIME)
}
}

#if defined CANT_RUN
public CBasePlayer_ResetMaxSpeed(const pPlayer)
{
if(pPlayer != g_pBombDefuser)
return HC_CONTINUE

set_entvar(pPlayer, var_maxspeed, 1.0)
return HC_SUPERCEDE
}
#endif

public CBasePlayerItem_AddToPlayer(const pWeapon, const pPlayer)
{
if(pWeapon <= 0)
return HAM_IGNORED

new pWeaponBox = get_entvar(pWeapon, var_owner)
if(pWeaponBox > 0 && FClassnameIs(pWeaponBox, "weaponbox")) {
set_task(0.2, "CWeaponBox_Killed", pWeaponBox)
}

if(g_bBombCracked && is_user_connected(pPlayer)) {
SendFakeAmmo(pPlayer) // типа подсказка (!) :D
}

return HAM_IGNORED
}

// Кто-то поднял бомбу при дефузе/фиксе отменим все
public CWeaponBox_Killed(const pWeaponBox)
{
if(is_nullent(pWeaponBox))
{
// server_print("g_bStartFix %s g_bStartDefuse %s", g_bStartFix ? "true":"false", g_bStartDefuse ? "true":"false")
if(g_bStartFix)
{
FinishDefuse(g_pBombFixer)
g_pBombFixer = 0
}
if(g_bStartDefuse)
{
FinishDefuse(g_pBombDefuser)
g_pBombDefuser = 0
}
}
}

public CWeaponbox_Think(const pWeaponBox)
{
if(pWeaponBox <= 0 || !get_member(pWeaponBox, m_WeaponBox_bIsBomb))
return HAM_IGNORED

new Float:flCurTime = get_gametime()

if(g_bStartDefuse && IsPlayer(g_pBombDefuser))
{
if(flCurTime < g_flDefuseCountDown)
{
new bool:bOnGround = IsOnGround(g_pBombDefuser)

if(flCurTime > g_flNextDefuse || !bOnGround)
{
if(!bOnGround) {
client_print(g_pBombDefuser, print_center, "Trebuie sa tii apasat CTRL pentru a sabota bomba!")
}

FinishDefuse(g_pBombDefuser)
g_pBombDefuser = 0
return HAM_IGNORED
}
}
else if(flCurTime >= g_flDefuseCountDown && get_entvar(g_pBombDefuser, var_deadflag) == DEAD_NO)
{
client_print(g_pBombDefuser, print_center, "Ai sabotat comba cu succes!")
FinishDefuse(g_pBombDefuser)
// BotPlantBomb(1)

PrintChatAll()

g_pBombFixer = 0
g_bBombCracked = true

g_iC4TimerOld = get_member_game(m_iC4Timer)
set_member_game(m_iC4Timer, max(0, BOMB_DETONATE_TIME))
#if defined BOMB_RADIUS
set_member_game(m_flBombRadius, floatmin(BOMB_RADIUS.0, MAX_BOMB_RADIUS))
#endif
}
else
{
FinishDefuse(g_pBombDefuser)
g_pBombDefuser = 0
}
}
else if(g_bStartFix && IsPlayer(g_pBombFixer))
{
if(flCurTime < g_flFixCountDown)
{
new bool:bOnGround = IsOnGround(g_pBombFixer)

if(flCurTime > g_flNextFix || !bOnGround)
{
if(!bOnGround) {
client_print(g_pBombFixer, print_center, "Trebuie sa tii apasat CTRL pentru a repara bomba!")
}

FinishDefuse(g_pBombFixer)
g_pBombFixer = 0
return HAM_IGNORED
}
}
else if(flCurTime >= g_flFixCountDown && get_entvar(g_pBombFixer, var_deadflag) == DEAD_NO)
{
client_print(g_pBombFixer, print_center, "Ai reparat bomba cu succes!")
FinishDefuse(g_pBombFixer)
// BotPlantBomb(0)

// PrintChatAll() // пока нет сообщений для теров

g_pBombDefuser = 0
g_bBombCracked = false

if(g_iC4TimerOld) {
set_member_game(m_iC4Timer, g_iC4TimerOld)
}
#if defined BOMB_RADIUS
if(g_flBombRadiusDefault > 0.0) {
set_member_game(m_flBombRadius, g_flBombRadiusDefault)
}
#endif
}
else
{
FinishDefuse(g_pBombFixer)
g_pBombFixer = 0
}
}

// CWeaponBox::BombThink() nextthink = 1.0 CGrenade::C4Think() nextthink = 0.12
set_entvar(pWeaponBox, var_nextthink, flCurTime + 0.2)

return HAM_SUPERCEDE
}

public CWeaponbox_ObjectCaps(const pWeaponBox)
{
if(pWeaponBox <= 0 || !get_member(pWeaponBox, m_WeaponBox_bIsBomb))
return HAM_IGNORED

SetHamReturnInteger(FCAP_CONTINUOUS_USE|FCAP_ONOFF_USE) // FCAP_ONOFF_USE unpressed button hook (value == 0.0)
return HAM_SUPERCEDE
}

public CWeaponbox_Use(const pWeaponBox, const pPlayer, const pCaller, const use_type, const Float:value)
{
if(pWeaponBox <= 0 || !IsPlayer(pPlayer) /* || !IsOnGround(pWeaponBox) */ )
return HAM_IGNORED

new TeamName:iTeam = get_member(pPlayer, m_iTeam)
#if !defined FIXING_TIME
if(iTeam != TEAM_CT)
return HAM_SUPERCEDE
#endif

new Float:flCurTime = get_gametime()

#if defined FIXING_TIME
if(iTeam == TEAM_CT)
#endif
{
if(g_bBombCracked)
{
if(g_pBombDefuser != pPlayer) {
client_print(pPlayer, print_center, "Bomba este deja sabotata!")
}

return HAM_SUPERCEDE
}

if(value == 1.0)
{
if(g_bStartDefuse)
{
g_flNextDefuse = flCurTime + 0.2
return HAM_SUPERCEDE // return HAM_IGNORED
}

new iSeconds = (get_member(pPlayer, m_bHasDefuser) ? (DEFUSE_TIME / 2) : DEFUSE_TIME)

g_bStartDefuse = true
g_pBombDefuser = pPlayer

g_flDefuseCountDown = flCurTime + float(iSeconds)
g_flNextDefuse = flCurTime + 0.2

StartDefuse(pPlayer, pWeaponBox, iSeconds)
}
else if(value == 0.0)
{
FinishDefuse(pPlayer)
g_pBombDefuser = 0
}
}
#if defined FIXING_TIME
else if(iTeam == TEAM_TERRORIST)
{
if(!g_bBombCracked)
{
if(g_pBombFixer != pPlayer) {
client_print(pPlayer, print_center, "Bomba este reparata!")
}

return HAM_SUPERCEDE
}

if(value == 1.0)
{
if(g_bStartFix)
{
g_flNextFix = flCurTime + 0.2
return HAM_SUPERCEDE // return HAM_IGNORED
}

g_bStartFix = true
g_pBombFixer = pPlayer

g_flFixCountDown = flCurTime + float(FIXING_TIME)
g_flNextFix = flCurTime + 0.2

StartDefuse(pPlayer, pWeaponBox, FIXING_TIME)
}
else if(value == 0.0)
{
FinishDefuse(pPlayer)
g_pBombFixer = 0
}
}
#endif
return HAM_IGNORED
}

StartDefuse(const pPlayer, const pWeaponBox, const iTime)
{
#if defined BOMB_USE_SAMPLE
emit_sound(pWeaponBox, CHAN_WEAPON, BOMB_USE_SAMPLE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
#endif
#if defined CANT_ATTACK
set_member(pPlayer, m_bIsDefusing, true)
#endif
#if defined CANT_RUN
set_entvar(pPlayer, var_maxspeed, 1.0)
#endif
rg_send_bartime(pPlayer, iTime)
set_member(pPlayer, m_bShieldDrawn, true)

ForwardToggle(true)
}

FinishDefuse(const pPlayer)
{
g_bStartDefuse = g_bStartFix = false
g_flDefuseCountDown = g_flNextDefuse = g_flFixCountDown = g_flNextFix = 0.0

ForwardToggle(false)

if(is_user_connected(pPlayer))
{
rg_send_bartime(pPlayer, 0) // reset bartime
#if defined CANT_RUN
rg_reset_maxspeed(pPlayer)
#endif
#if defined CANT_ATTACK
set_member(pPlayer, m_bIsDefusing, false)
#endif
set_member(pPlayer, m_bShieldDrawn, false)
}
}

ForwardToggle(const bool:Enable)
{
if(Enable)
{
EnableHamForward(g_hBombThink)
#if defined CANT_RUN
EnableHookChain(g_hResetMaxSpeed)
#endif
}
else
{
DisableHamForward(g_hBombThink)
#if defined CANT_RUN
DisableHookChain(g_hResetMaxSpeed)
#endif
}
}

PrintChatAll()
{
new iPlayers[32], szDefuserName[32], szTempMsg[140], iCount, pReceiver

get_players(iPlayers, iCount, "ace", "CT")
get_user_name(g_pBombDefuser, szDefuserName, charsmax(szDefuserName))

switch(random_num(1, 7))
{
case 1: formatex(szTempMsg, charsmax(szTempMsg), "^3%s^1^4: ^1nu mai campam siteul", szDefuserName)
case 2: formatex(szTempMsg, charsmax(szTempMsg), "^3%s^1^4: ^1le da un sfat:nu mai plantati bomba ^4:)", szDefuserName)
case 3: formatex(szTempMsg, charsmax(szTempMsg), "^4* ^3%s ^1a lasat un cadou teroristilor.", szDefuserName)
case 4: formatex(szTempMsg, charsmax(szTempMsg), "^3%s^1^4: ^1a sabotat bomba ^4:D", szDefuserName)
case 5: formatex(szTempMsg, charsmax(szTempMsg), "^4* ^1Se pare ca ^3%s ^1vrea sa isi bata joc de teroristi.", szDefuserName)
case 6: formatex(szTempMsg, charsmax(szTempMsg), "^4* ^1Coechipierul tau ^3%s ^1a sabotat bomba ^4хD", szDefuserName)
case 7: formatex(szTempMsg, charsmax(szTempMsg), "^4* ^1Atentie! ^3%s ^1a sabotat bomba.", szDefuserName)
}

for(--iCount; iCount >= 0; iCount--)
{
pReceiver = iPlayers[iCount]
#if !defined TEST_PRINT_CHAT
if(g_pBombDefuser == pReceiver)
continue
#endif
client_print_color(pReceiver, print_team_default, "%s", szTempMsg)
}
}

stock SendFakeAmmo(const pPlayer)
{
static gmsgAmmoPickup; static const AMMO_C4 = 14
if(gmsgAmmoPickup || (gmsgAmmoPickup = get_user_msgid("AmmoPickup")))
{
set_msg_block(gmsgAmmoPickup, BLOCK_ONCE)
message_begin(MSG_ONE, gmsgAmmoPickup, .player = pPlayer)
write_byte(AMMO_C4)
write_byte(2) // amount
message_end()
}
}

stock BotPlantBomb(value)
{
if(!bot_deathmatch)
return

if((value == 1 && random_float(0.0, 5.00) < 1.77) || value == 0) {
set_pcvar_num(bot_deathmatch, value)
}
}

// by VEN
stock get_loguser_index()
{
new loguser[80], name[32]
read_logargv(0, loguser, charsmax(loguser))
parse_loguser(loguser, name, charsmax(name))

return get_user_index(name)
}
-
 
Сообщения
673
Реакции
242
Помог
11 раз(а)
SetHookChainReturn: trying to set return value with incompatible type, expected 'ATYPE_BOOL'; got 'ATYPE_INTEGER'

re_ct_bomb_cracker.sma::RoundEnd (line 151)

1615302021322.png
 

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

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