- Ошибка
-
None.
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.8.3-dev+5154 (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: Mar 11 2018 07:25:29
Built from: https://github.com/alliedmodders/amxmodx/commit/2559fcf0
Build ID: 5154:2559fcf0
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 09:10:05 Jul 7 2017 (7561)
- ReGamedll
-
ReGameDLL version: 5.7.0.312-dev
Build date: 07:53:34 May 31 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/26db32e
- Версия Metamod
-
Metamod v1.21-am 2013-03-15 (5:13)
by Will Day <[email protected]>
http://www.metamod.org/
compiled: Mar 15 2013, 15:20:21 (msc optimized)
- Список метамодулей
-
[ 1] AMX Mod X RUN - amxmodx_mm_i386. v1.8.3-d ini Start ANY
[ 2] Ham Sandwich RUN - hamsandwich_amxx v1.8.3-d pl1 ANY ANY
[ 3] CSX RUN - csx_amxx_i386.so v1.8.3-d pl1 ANY ANY
[ 4] Engine RUN - engine_amxx_i386 v1.8.3-d pl1 ANY ANY
[ 5] FakeMeta RUN - fakemeta_amxx_i3 v1.8.3-d pl1 ANY ANY
[ 6] ReAPI RUN - reapi_amxx_i386. v5.6.0.1 pl1 ANY Never
- Список плагинов
-
[ 1] Admin Base 1.8.3-dev+ AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.8.3-dev+ AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.8.3-dev+ AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.8.3-dev+ AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.8.3-dev+ AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.8.3-dev+ AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.8.3-dev+ AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.8.3-dev+ AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.8.3-dev+ AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.8.3-dev+ AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.8.3-dev+ AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.8.3-dev+ AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.8.3-dev+ AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.8.3-dev+ AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.8.3-dev+ AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.8.3-dev+ AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.8.3-dev+ AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.8.3-dev+ AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.8.3-dev+ AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.8.3-dev+ AMXX Dev Team statscfg.amxx running
[ 21] StatsX 1.8.3-dev+ AMXX Dev Team statsx.amxx running
[ 22] [AMXX] Settings API 1.0 MeRcyLeZZ amx_settings_ap running
[ 23] Aliens vs Predator Mod v1.0.2 Crazy aliens_vs_preda debug
[ 24] [AvP] Weapons v1.0.2 Crazy avp_weapons.amx debug
[ 25] [AvP] Abilities v1.0.2 Crazy avp_abilities.a debug
[ 26] [AvP] M-4A4 Pistol v1.0.2 Crazy avp_m4a4_pistol debug
[ 27] [AvP] Shotgun v1.0.2 Crazy avp_shotgun.amx debug
[ 28] [AvP] Default Weapons v1.0.2 Crazy avp_default_wea debug
[ 29] [AvP] Ability: Motion v1.0.2 Crazy avp_ability_mot debug
[ 30] [AvP] Alien Species v1.0.2 Crazy avp_alien_speci debug
[ 31] [AvP] Marine Species v1.0.2 Crazy avp_marine_spec debug
[ 32] [AvP] Marine Class 1.0 Crazy avp_marine_clas debug
[ 33] [AvP] Gameplay Fixes v1.0.2 Crazy avp_gameplay_fi debug
- Автор плагина
- Crazy
- Версия плагина
- v1.0.2
- Исходный код
-
#include <amxmodx>
#include <reapi>
#include <fakemeta>
#include <hamsandwich>
#include <xs>
#include <avp_marine_species>
const SHOTGUN_WEAPONBOX_KEY = 1001;
#define isShotgun(%1) (get_entvar(%1, var_impulse) == SHOTGUN_WEAPONBOX_KEY)
enum _:eWeaponModel
{
WEAPON_V_MODEL = 0,
WEAPON_P_MODEL,
WEAPON_W_MODEL,
};
enum _:eWeaponAnim
{
WEAPON_IDLE = 0,
WEAPON_SHOOT1,
WEAPON_SHOOT2,
WEAPON_RELOAD2,
WEAPON_RELOAD3,
WEAPON_RELOAD1,
WEAPON_DRAW,
};
new const g_szShotgunModels[eWeaponModel][] =
{
"models/avp/v_shotgun.mdl",
"models/p_m3.mdl",
"models/w_m3.mdl"
};
new const g_szSoundShotgunFire[] = "avp/shotgun_fire.wav";
new const g_szSoundWeaponEmpty[] = "weapons/dryfire_rifle.wav";
new const g_szM3Ent[] = "weapon_m3";
new g_iShotgunId, g_iMsgWeaponList;
new pCvarShotgunMaxRounds, pCvarShotgunClipSize; //pCvarShotgunDamage;
public plugin_init()
{
pCvarShotgunClipSize = register_cvar("avp_shotgun_ammo", "6");
pCvarShotgunMaxRounds = register_cvar("avp_shotgun_bpammo", "42");
//pCvarShotgunDamage = register_cvar("avp_shotgun_damage", "35");
g_iMsgWeaponList = get_user_msgid("WeaponList");
register_clcmd("weapon_shotgun", "cmdShotgun");
RegisterHam(Ham_Item_Deploy, g_szM3Ent, "CM3_Deploy_Post", 1);
RegisterHam(Ham_Weapon_PrimaryAttack, g_szM3Ent, "CM3_PrimaryAttack");
RegisterHam(Ham_Weapon_Reload, g_szM3Ent, "CM3_Reload");
RegisterHam(Ham_Weapon_Reload, g_szM3Ent, "CM3_Reload_Post", 1);
RegisterHam(Ham_Item_AddToPlayer, g_szM3Ent, "CM3_AddToPlayer_Post", 1);
RegisterHookChain(RG_CWeaponBox_SetModel, "CWeaponBox_SetModel");
RegisterHookChain(RG_CSGameRules_CanHavePlayerItem, "CBasePlayer_CanHaveItem");
register_forward(FM_UpdateClientData, "CBasePlayer_UpdateData_Post", 1);
}
public plugin_precache()
{
register_plugin("[AvP] Shotgun", AVP_VERSION_STR, "Crazy");
g_iShotgunId = avp_weapon_add("Shotgun", AVP_TEAM_MARINE);
for (new i = WEAPON_V_MODEL; i <= WEAPON_W_MODEL; i++)
precache_model(g_szShotgunModels[i]);
precache_generic("sprites/avp/640hud1.spr");
precache_generic("sprites/weapon_shotgun.txt");
precache_sound(g_szSoundShotgunFire);
}
public avp_fw_give_weapon(this, iWeaponId)
{
if (iWeaponId != g_iShotgunId)
return;
rg_remove_item(this, g_szM3Ent, true);
new pevWeapon = rg_give_item(this, g_szM3Ent);
new iMaxRounds = get_pcvar_num(pCvarShotgunMaxRounds);
new iClipSize = get_pcvar_num(pCvarShotgunClipSize);
set_entvar(pevWeapon, var_impulse, SHOTGUN_WEAPONBOX_KEY);
rg_set_iteminfo(pevWeapon, ItemInfo_iMaxClip, iClipSize);
rg_set_iteminfo(pevWeapon, ItemInfo_iMaxAmmo1, iMaxRounds);
rg_set_user_bpammo(this, WEAPON_M3, iMaxRounds);
set_member(pevWeapon, m_Weapon_iClip, iClipSize);
ExecuteHamB(Ham_Item_AddToPlayer, pevWeapon, this);
rg_switch_weapon(this, pevWeapon);
}
public avp_fw_can_have_weapon(this, iWeaponId)
{
if (iWeaponId != g_iShotgunId)
return AVP_CONTINUE;
new iClassId = avp_marine_class_get(this);
if (!(avp_marine_class_get_weapons(iClassId) & (1<<iWeaponId)))
return AVP_SUPERCEDE;
return AVP_CONTINUE;
}
public cmdShotgun(this)
{
engclient_cmd(this, "weapon_m3");
}
public CM3_Deploy_Post(this)
{
if (!isShotgun(this))
return;
new pevOwner = get_member(this, m_pPlayer);
set_entvar(pevOwner, var_viewmodel, g_szShotgunModels[WEAPON_V_MODEL]);
set_entvar(pevOwner, var_weaponmodel, g_szShotgunModels[WEAPON_P_MODEL]);
set_member(this, m_Weapon_flAccuracy, 0.9);
setWeaponTimeBase(this, 0.75);
ExecuteHamB(Ham_CS_Weapon_SendWeaponAnim, this, WEAPON_DRAW, false);
}
public CM3_PrimaryAttack(this)
{
if (!isShotgun(this))
return HAM_IGNORED;
client_print(0, print_chat, "isShotgun");
new pevOwner = get_member(this, m_pPlayer);
if (get_entvar(pevOwner, var_waterlevel) == 3)
{
emit_sound(pevOwner, CHAN_WEAPON, g_szSoundWeaponEmpty, 0.8, ATTN_NORM, 0, PITCH_NORM);
set_member(this, m_Weapon_flNextPrimaryAttack, 0.15);
return HAM_SUPERCEDE;
}
new iClip = get_member(this, m_Weapon_iClip);
if (iClip <= 0)
{
ExecuteHamB(Ham_Weapon_Reload, this);
if (!get_member(this, m_Weapon_iClip))
emit_sound(pevOwner, CHAN_WEAPON, g_szSoundWeaponEmpty, 0.8, ATTN_NORM, 0, PITCH_NORM);
set_member(this, m_Weapon_flNextPrimaryAttack, 1.0);
return HAM_SUPERCEDE;
}
iClip--;
set_member(this, m_Weapon_iClip, iClip);
rg_set_animation(pevOwner, PLAYER_ATTACK1);
emit_sound(pevOwner, CHAN_WEAPON, g_szSoundShotgunFire, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
ExecuteHamB(Ham_CS_Weapon_SendWeaponAnim, this, random_num(WEAPON_SHOOT1, WEAPON_SHOOT2), false);
fireBullets(this);
set_member(this, m_Weapon_flNextPrimaryAttack, 0.875);
set_member(this, m_Weapon_flNextSecondaryAttack, 0.875);
set_member(this, m_Weapon_fInSpecialReload, 0);
if (iClip > 0)
{
set_member(this, m_M3_flPumpTime, 0.5);
set_member(this, m_Weapon_flTimeWeaponIdle, 2.5);
}
else
{
set_member(this, m_Weapon_flTimeWeaponIdle, 0.875);
}
new Float:flGlbTime, Float:vecPunchAngle[3], Float:flRandomNumbers[3];
global_get(glb_time, flGlbTime);
get_entvar(pevOwner, var_punchangle, vecPunchAngle);
if (get_entvar(pevOwner, var_flags) & FL_ONGROUND)
{
flRandomNumbers[0] = get_member(pevOwner, random_seed) + 1.0;
flRandomNumbers[1] = 4.0;
flRandomNumbers[2] = 6.0;
}
else
{
flRandomNumbers[0] = get_member(pevOwner, random_seed) + 1.0;
flRandomNumbers[1] = 8.0;
flRandomNumbers[2] = 11.0;
}
vecPunchAngle[0] -= flRandomNumbers[random(sizeof flRandomNumbers)];
set_entvar(pevOwner, var_punchangle, vecPunchAngle);
set_member(pevOwner, m_flEjectBrass, flGlbTime + 0.45);
return HAM_SUPERCEDE;
}
public CM3_Reload(this)
{
if (!isShotgun(this))
return HAM_IGNORED;
new pevOwner = get_member(this, m_pPlayer);
new iAmmo = min(get_pcvar_num(pCvarShotgunClipSize) - get_member(this, m_Weapon_iClip), get_member(pevOwner, m_rgAmmo, get_member(this, m_Weapon_iPrimaryAmmoType)))
if (iAmmo == 0)
return HAM_SUPERCEDE;
if (get_member(this, m_Weapon_flNextPrimaryAttack) > 0.0)
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
public CM3_Reload_Post(this)
{
if (!isShotgun(this))
return;
if (GetHamReturnStatus() == HAM_SUPERCEDE)
return;
/*new
if (get_member(this, m_Weapon_fInReload))
{
}
new pevOwner = get_member(this, m_pPlayer);
set_member(pevOwner, m_flTimeWeaponIdle, 1.85);
set_member(pevOwner, m_flNextAttack, 1.85);*/
//ExecuteHamB(Ham_CS_Weapon_SendWeaponAnim, this, WEAPON_RELOAD, false);
}
public CM3_AddToPlayer_Post(this, pevPlayer)
{
if (!is_entity(this))
return;
if (!is_user_alive(pevPlayer))
return;
if (!isShotgun(this))
return;
message_begin(MSG_ONE, g_iMsgWeaponList, .player = pevPlayer)
{
write_string("weapon_shotgun");
write_byte(get_member(this, m_Weapon_iPrimaryAmmoType));
write_byte(rg_get_iteminfo(this, ItemInfo_iMaxAmmo1));
write_byte(get_member(this, m_Weapon_iSecondaryAmmoType));
write_byte(rg_get_iteminfo(this, ItemInfo_iMaxAmmo2));
write_byte(rg_get_iteminfo(this, ItemInfo_iSlot));
write_byte(rg_get_iteminfo(this, ItemInfo_iPosition));
write_byte(CSW_M3);
write_byte(0);
}
message_end();
}
public CWeaponBox_SetModel(this, const szModel[])
{
new pevWeapon;
for (new i = 0; i < MAX_ITEM_TYPES; i++)
{
pevWeapon = get_member(this, m_WeaponBox_rgpPlayerItems, i);
if (!is_entity(pevWeapon))
continue;
if (!isShotgun(pevWeapon))
continue;
SetHookChainArg(2, ATYPE_STRING, g_szShotgunModels[WEAPON_W_MODEL]);
break;
}
return HC_CONTINUE;
}
public CBasePlayer_CanHaveItem(this, pevWeapon)
{
if (!is_user_alive(this))
return HC_CONTINUE;
if (!isShotgun(pevWeapon))
return HC_CONTINUE;
if (avp_can_have_weapon(this, g_iShotgunId))
return HC_CONTINUE;
SetHookChainReturn(ATYPE_INTEGER, false);
return HC_SUPERCEDE;
}
public CBasePlayer_UpdateData_Post(this, iSendWeapons, hClientData)
{
if (!is_user_alive(this))
return;
static pevWeapon;
pevWeapon = get_member(this, m_pActiveItem);
if (!is_entity(pevWeapon))
return;
if (!isShotgun(pevWeapon))
return;
set_cd(hClientData, CD_flNextAttack, 2.0);
}
setWeaponTimeBase(this, Float:flTime)
{
set_member(this, m_Weapon_flNextPrimaryAttack, flTime);
set_member(this, m_Weapon_flNextReload, flTime);
set_member(this, m_Weapon_flTimeWeaponIdle, flTime);
}
fireBullets(this)
{
new Float:vecSrc[3], Float:vecDir[3], Float:vecViewAngle[3], Float:vecPunchAngle[3];
new pevOwner = get_member(this, m_pPlayer);
get_entvar(pevOwner, var_v_angle, vecViewAngle);
get_entvar(pevOwner, var_punchangle, vecPunchAngle);
xs_vec_add(vecViewAngle, vecPunchAngle, vecViewAngle);
engfunc(EngFunc_MakeVectors, vecViewAngle);
ExecuteHamB(Ham_Player_GetGunPosition, pevOwner, vecSrc);
global_get(glb_v_forward, vecDir);
rg_fire_bullets(this, pevOwner, 9, vecSrc, vecDir, Float:{0.0675, 0.0675, 0.0}, 3000.0, BULLET_PLAYER_BUCKSHOT, 0, 0);
engfunc(EngFunc_PlaybackEvent, FEV_HOSTONLY, pevOwner, get_member(this, m_M3_usFire), 0.0, NULL_VECTOR, NULL_VECTOR, 0.0, 0.0, 0, 0, false, false);
}
Hello, I'm trying to set custom fire sounds in M3. I've already removed client prediction, it's working but sound is not being emitted. I've test with other weapons and it's working fine, this problem only happens with M3.