Пользователь
- Сообщения
- 11
- Реакции
- 0
- Ошибка
-
AK47_with_bayonet.amxx не бьёт со штык ножа
- ОС
- Linux
- Amx Mod X
-
AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5291
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.767-dev
Build date: 03:13:55 Oct 25 2021 (2753)
- ReGamedll
-
ReGameDLL version: 5.21.0.534-dev
Build date: 18:28:48 Sep 02 2021
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
- Список метамодулей
-
[ 1] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.92d ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 5] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5291 ini Start ANY
[ 6] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini Chlvl ANY
[ 8] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 9] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5291 pl5 ANY ANY
[10] MySQL RUN - mysql_amxx_i386.so v1.9.0.5291 pl5 ANY ANY
[11] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5291 pl5 ANY ANY
[12] Engine RUN - engine_amxx_i386.so v1.9.0.5291 pl5 ANY ANY
[13] ReAPI RUN - reapi_amxx_i386.so v5.21.0.248-dev pl5 ANY Never
[14] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl5 ANY Never
[15] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5291 pl5 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5291 pl5 ANY ANY
[17] Fun RUN - fun_amxx_i386.so v1.9.0.5291 pl5 ANY ANY
17 plugins, 17 running
- Список плагинов
-
[ 1] FreshBans 1.4.5b kanagava fresh_bans_1.4. running
[ 2] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 3] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 4] [182] MapChooser RBS 20.08.02 SKAJIbnEJIb & UF mapchooser_rbs. running
[ 5] [182] TimeLeft 18.09.25 SKAJIbnEJIb & AM timeleft.amxx running
[ 6] [182] NextMap 18.09.25 SKAJIbnEJIb & AM nextmap.amxx running
[ 7] Admin Loader 3.5 neygomon admin_loader.am running
[ 8] Admin Commands 1.9.0.5291 AMXX Dev Team admincmd.amxx running
[ 9] Players Menu 1.7 neugomon players_menu.am running
[ 10] Admin Chat 1.9.0.5291 AMXX Dev Team adminchat.amxx running
[ 11] Maps Menu 1.9.0.5291 AMXX Dev Team mapsmenu.amxx running
[ 12] Restrict Weapons 1.8.1.3746 AMXX Dev Team restmenu.amxx running
[ 13] Admin Votes 1.9.0.5291 AMXX Dev Team adminvote.amxx running
[ 14] c4 timer 1.1 cheap_suit c4timer.amxx running
[ 15] Stats Configuration 1.9.0.5291 AMXX Dev Team statscfg.amxx running
[ 16] [GM] VIP Test 1.0.0 [GM] NWC gm_vip_test.amx running
[ 17] Commands Menu 20.06.06 SKAJIbnEJIb & AM cmdmenu_rbs.amx running
[ 18] [182] Ultimate Weapons 21.03.23 SKAJIbnEJIb ultimate_weapon running
[ 19] [182] VIP RBS 20.07.20 SKAJIbnEJIb vip_rbs.amxx running
[ 20] [182] Snipers RBS 20.06.06 SKAJIbnEJIb snipers_rbs.amx running
[ 21] [182] Demo Recorder RB 17.08.11 SKAJIbnEJIb demorecorder_rb running
[ 22] Menus Front-End 1.5 neugomon menufront_end.a running
[ 23] MenuGen 1.0 CrAsH MenuGen.amxx running
[ 24] Mode 2x2 2.5_reapi s1lent mode.amxx running
[ 25] Invisible Spectator 1.0 ReHLDS Team invisible_spect running
[ 26] WeaponMenu 1.1 neygomon wmenu.amxx running
[ 27] fb_forwards 0.1.8 Mazdan & Neugomo fb_forwards.amx running
[ 28] Fire in the hole 1.0 CHEL74 fire_in_the_hol running
[ 29] Screen_Fade 0.0.5 Vaqtincha screen_fade.amx running
[ 30] AFK Control 1.4.1 [Rnd neygomon afk_control.amx running
[ 31] Ping Control 1.31 neygomon ping_control.am running
[ 32] [190] Top Award RBS 20.06.06 SKAJIbnEJIb topaward_rbs.am running
[ 33] Info Rank 0.2 maFFyoZZyk info_rank.amxx running
[ 34] [182] Parachute 17.08.11 KRoT@L/JTP10181 parachute_rbs.a running
[ 35] Spect Bot 1.4 Jack Daniel`s spect_bot.amxx running
[ 36] ReChecker Logging 1.0 AMXX rc_logging.amxx running
[ 37] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am running
[ 38] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 39] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 40] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 41] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 42] AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_cstr running
[ 43] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 44] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
[ 45] Reklama 20.05.2020 mx?! reklama.amxx running
[ 46] HUD_Adverts 1.3.1 pUzzlik hud_adverts.amx running
[ 47] Anti Reklama 1.1 MarcaD anti_reklama.am running
[ 48] Block Advert 1.4 neygomon block_advert.am running
[ 49] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 50] Injector X 1.0 Deadly|Darkness injector.amxx running
[ 51] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash.a running
[ 52] Rock to Ban 1.02 Safety1st rock2ban.amxx running
[ 53] Lite TeamBalancer 1.20 neygomon lite_balancer.a running
[ 54] Reset Score 1.0 SKAJIbnEJIb resetscore_rbs. running
54 plugins, 54 running
- Автор плагина
- Ruby
- Версия плагина
- 1.2
- Исходный код
-
include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <reapi>
#include <xs>
#define INSTANCE(%0) ( ( %0 == -1 ) ? 0 : %0 )
#define IsDefaultWeapon(%0) bool: ( get_entvar( %0, var_impulse ) == 0 )
new const WEAPON_REFERENCE[ ] = "weapon_ak47";
new const WEAPON_MODEL_VIEW[ ] = "models/GOLD_pRO/v_ak47bayonet.mdl";
new const WEAPON_MODEL_PLAYER[ ] = "models/GOLD_pRO/p_ak47bayonet.mdl";
new const WEAPON_MODEL_WORLD[ ] = "models/GOLD_pRO/w_ak47bayonet.mdl";
new const WEAPON_SOUNDS[ ][ ] =
{
"weapons/knife_slash1.wav",
"weapons/knife_hitwall1.wav",
"weapons/knife_hit3.wav",
"weapons/akm_draw.wav"
};
const WEAPON_MODEL_WORLD_BODY = 0;
const Float: WEAPON_ATTACK_DISTANCE = 50.0; // Дистанция удара штык-ножа.
const Float: WEAPON_ATTACK_DAMAGE = 55.0; // Урон от штык-ножа. ( Изменяется в зависимости от части тела в которую попали.)
const WEAPON_ATTACK_DAMAGE_TYPE = ( DMG_BULLET | DMG_NEVERGIB );
public plugin_init( )
{
register_plugin( "Weapon: AK-47 with bayonet", "1.2", "Ruby" );;
RegisterHookChain( RG_CWeaponBox_SetModel, "CWeaponBox__SetModel_Pre", false );
RegisterHam( Ham_Spawn, WEAPON_REFERENCE, "CBasePlayerWeapon__Spawn_Post", true );
RegisterHam( Ham_Item_Deploy, WEAPON_REFERENCE, "CBasePlayerWeapon__Deploy_Post", true );
RegisterHam( Ham_Weapon_PrimaryAttack, WEAPON_REFERENCE, "CBasePlayerWeapon__PrimaryAttack_Post", true );
RegisterHam( Ham_Weapon_SecondaryAttack, WEAPON_REFERENCE, "CBasePlayerWeapon__SecondaryAttack_Pre", false );
}
public plugin_precache( )
{
engfunc( EngFunc_PrecacheModel, WEAPON_MODEL_VIEW );
engfunc( EngFunc_PrecacheModel, WEAPON_MODEL_PLAYER );
engfunc( EngFunc_PrecacheModel, WEAPON_MODEL_WORLD );
engfunc( EngFunc_PrecacheSound, WEAPON_SOUNDS[ 3 ] );
}
public CWeaponBox__SetModel_Pre( const pWeaponBox, const szModel[ ] )
{
new pItem = get_member( pWeaponBox, m_WeaponBox_rgpPlayerItems, PRIMARY_WEAPON_SLOT );
if ( is_nullent( pItem ) || get_member( pItem, m_iId ) != WEAPON_AK47 || !IsDefaultWeapon( pItem ) )
return HC_CONTINUE;
SetHookChainArg( 2, ATYPE_STRING, WEAPON_MODEL_WORLD );
set_entvar( pWeaponBox, var_body, WEAPON_MODEL_WORLD_BODY );
return HC_CONTINUE;
}
public CBasePlayerWeapon__Spawn_Post( const pItem )
{
if ( !IsDefaultWeapon( pItem ) )
return;
set_member( pItem, m_Weapon_bHasSecondaryAttack, true );
}
public CBasePlayerWeapon__Deploy_Post( const pItem )
{
if ( !IsDefaultWeapon( pItem ) )
return;
new pPlayer = get_member( pItem, m_pPlayer );
set_entvar( pPlayer, var_viewmodel, WEAPON_MODEL_VIEW );
set_entvar( pPlayer, var_weaponmodel, WEAPON_MODEL_PLAYER );
}
public CBasePlayerWeapon__PrimaryAttack_Post( const pItem )
{
if ( !IsDefaultWeapon( pItem ) )
return;
set_member( pItem, m_Weapon_flNextSecondaryAttack, 0.85 );
}
public CBasePlayerWeapon__SecondaryAttack_Pre( const pItem )
{
if ( !IsDefaultWeapon( pItem ) )
return HAM_IGNORED;
new pPlayer = get_member( pItem, m_pPlayer );
UTIL_SendWeaponAnim( MSG_ONE, pPlayer, 6 );
set_member( pItem, m_Weapon_flNextPrimaryAttack, 1.2 );
set_member( pItem, m_Weapon_flNextSecondaryAttack, 1.3 );
set_member( pItem, m_Weapon_flTimeWeaponIdle, 1.3 );
new Float: vecOrigin[ 3 ]; get_entvar( pPlayer, var_origin, vecOrigin );
new Float: vecViewOfs[ 3 ]; get_entvar( pPlayer, var_view_ofs, vecViewOfs );
xs_vec_add( vecOrigin, vecViewOfs, vecOrigin );
new Float: vecAngles[ 3 ]; get_entvar( pPlayer, var_v_angle, vecAngles );
new Float: vecViewAngle[ 3 ]; get_entvar( pPlayer, var_v_angle, vecViewAngle );
new Float: vecForward[ 3 ]; angle_vector( vecAngles, ANGLEVECTOR_FORWARD, vecForward );
new Float: vecEnd[ 3 ]; xs_vec_add_scaled( vecOrigin, vecForward, WEAPON_ATTACK_DISTANCE, vecEnd );
new pTrace = create_tr2( ); engfunc( EngFunc_TraceLine, vecOrigin, vecEnd, DONT_IGNORE_MONSTERS, pPlayer, pTrace );
new Float: flFraction; get_tr2( pTrace, TR_flFraction, flFraction );
if ( flFraction == 1.0 )
{
rh_emit_sound2( pPlayer, 0, CHAN_ITEM, WEAPON_SOUNDS[ 0 ] );
return HAM_SUPERCEDE;
}
new pHit = INSTANCE( get_tr2( pTrace, TR_pHit ) );
rg_multidmg_clear( );
ExecuteHamB( Ham_TraceAttack, pHit, pPlayer, WEAPON_ATTACK_DAMAGE, vecForward, pTrace, WEAPON_ATTACK_DAMAGE_TYPE );
rg_multidmg_apply( pItem, pPlayer );
free_tr2( pTrace );
rh_emit_sound2( pPlayer, 0, CHAN_ITEM, WEAPON_SOUNDS[ ExecuteHam( Ham_IsPlayer, pHit ) ? 2 : 1 ] );
return HAM_SUPERCEDE;
}
stock UTIL_SendWeaponAnim( const iDest, const pPlayer, const iAnim )
{
set_entvar( pPlayer, var_weaponanim, iAnim );
message_begin( iDest, SVC_WEAPONANIM, _, pPlayer );
write_byte( iAnim );
write_byte( 0 );
message_end( );
}
Плагин сам пока отключил,логи чистые, в коде почти не понимаю , есть ошибка в коде? не бьёт со штык ножа AK47_with_bayonet.amxx