VALHALLA
Пользователь
- Регистрация
- 17 Сен 2017
- Сообщения
- 55
- Симпатии
- 2
Есть мод, который добавляет гранаты как в CS GO, звуки при броске гранаты и густой дым..
По сути из этого мода нужно только последнее, чтобы был только дым.
Попробовал всё лишнее сам отключить, закомментить дефайны.. но по скольку в этом не разбираюсь особо, ниче не вышло. Плагин не компилится, errorов больше чем иголок на ёлке)
Хелпаните плз с этой проблемкой.
И ещё вопрос на засыпку:
В подобных плагинах, при раскрывании дыма в конце раунда, в новом раунде он остаётся.. это как-нибудь реально пофиксить ? Это, кстати, очень важный вопросец)
Спасибо.
По сути из этого мода нужно только последнее, чтобы был только дым.
Попробовал всё лишнее сам отключить, закомментить дефайны.. но по скольку в этом не разбираюсь особо, ниче не вышло. Плагин не компилится, errorов больше чем иголок на ёлке)
Хелпаните плз с этой проблемкой.
// Файл скачан с паблика Good Plugins.
// vk.com/good_plugins - сборки серверов, плагины, модели, карты и т.д.
// #define REAL_RADIO // Отключить озвучку CS:GO - закомментируйте.
#define BLOCK_FITH_TEXT // Блокирует сообщение "Fire in the hole!".
new const SOUND_SMOKE[] = "grenade_mode/smoke.wav"
new const SOUND_FLASH[] = "grenade_mode/flash.wav"
new const SOUND_HEGREN[] = "grenade_mode/he.wav"
#define GRENADE_VIEW_MODEL "models/grenade_mode/v_he.mdl"
#define GRENADE_WORLD_MODEL "models/grenade_mode/w_he.mdl"
#define GRENADE_PLAYER_MODEL "models/grenade_mode/p_he.mdl"
#define SMOKE_VIEW_MODEL "models/grenade_mode/v_smoke.mdl"
#define SMOKE_WORLD_MODEL "models/grenade_mode/w_smoke.mdl"
#define SMOKE_PLAYER_MODEL "models/grenade_mode/p_smoke.mdl"
#define FLASH_VIEW_MODEL "models/grenade_mode/v_flash.mdl"
#define FLASH_WORLD_MODEL "models/grenade_mode/w_flash.mdl"
#define FLASH_PLAYER_MODEL "models/grenade_mode/p_flash.mdl"
#define MAX_SOUND_PATH_LENGTH 32
#define MAXPLAYERS 32
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif
#define PRECACHE_MODEL(%0) engfunc(EngFunc_PrecacheModel, %0)
#define SET_MODEL(%0,%1) engfunc(EngFunc_SetModel, %0, %1)
#define IsValidPev(%0) (pev_valid(%0) == 2)
#define BitSet(%0,%1) (%0 |= (1 << (%1 - 1)))
#define BitClear(%0,%1) (%0 &= ~(1 << (%1 - 1)))
#define BitCheck(%0,%1) (%0 & (1 << (%1 - 1)))
#define m_pPlayer 41
#define extra_offset_weapon 4
enum _:Models
{
HE,
SG,
FB
}
new gMsgIdSendAudio
new gBlockSound[MAXPLAYERS + 1]
new const g_szClassname[] = "Smoke"
new const OldWorldModels[][] = { "models/w_hegrenade.mdl", "models/w_smokegrenade.mdl", "models/w_flashbang.mdl" }
new const NewViewModels[][] = { GRENADE_VIEW_MODEL, SMOKE_VIEW_MODEL, FLASH_VIEW_MODEL }
new const NewWorldModels[][] = { GRENADE_WORLD_MODEL, SMOKE_WORLD_MODEL, FLASH_WORLD_MODEL }
new const NewPlayerModels[][] = { GRENADE_PLAYER_MODEL, SMOKE_PLAYER_MODEL, FLASH_PLAYER_MODEL }
new g_bitIsConnected
new g_szSmokeSprite
public plugin_precache()
{
PrecacheModels()
PrecacheSounds()
g_szSmokeSprite = precache_model( "sprites/grenade_mode/smoke.spr" )
}
public plugin_init()
{
register_plugin("Grenade Mode", "0.6", "gyxoBka")
register_clcmd("say /gs", "cmdBlockSound")
register_clcmd("say_team /gs", "cmdBlockSound")
register_touch( g_szClassname, "worldspawn", "FwdTouch_FakeSmoke" )
register_think( g_szClassname, "FwdThink_FakeSmoke" )
register_forward( FM_EmitSound, "FwdEmitSound" )
RegisterHam(Ham_Item_Deploy, "weapon_hegrenade", "OnDeployHe", true)
RegisterHam(Ham_Item_Deploy, "weapon_flashbang", "OnDeployFb", true)
RegisterHam(Ham_Item_Deploy, "weapon_smokegrenade", "OnDeploySg", true)
register_forward(FM_SetModel, "FakeMeta_SetModel", false)
register_message(get_user_msgid("TextMsg"), "Message_TextMsg")
gMsgIdSendAudio = get_user_msgid("SendAudio")
}
public client_putinserver(id)
{
BitSet(g_bitIsConnected, id);
gBlockSound[id] = 0
}
#if AMXX_VERSION_NUM < 183
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
BitClear(g_bitIsConnected, id)
}
public OnDeployHe(const iItem)
{
new iPlayer
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
static iszViewModel;
if (iszViewModel || (iszViewModel = engfunc(EngFunc_AllocString, GRENADE_VIEW_MODEL)))
{
set_pev_string(iPlayer, pev_viewmodel2, iszViewModel)
}
static iszPlayerModel;
if (iszPlayerModel || (iszPlayerModel = engfunc(EngFunc_AllocString, GRENADE_PLAYER_MODEL)))
{
set_pev_string(iPlayer, pev_weaponmodel2, iszPlayerModel)
}
return HAM_IGNORED;
}
public OnDeployFb(const iItem)
{
new iPlayer
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
static iszViewModel;
if (iszViewModel || (iszViewModel = engfunc(EngFunc_AllocString, FLASH_VIEW_MODEL)))
{
set_pev_string(iPlayer, pev_viewmodel2, iszViewModel)
}
static iszPlayerModel;
if (iszPlayerModel || (iszPlayerModel = engfunc(EngFunc_AllocString, FLASH_PLAYER_MODEL)))
{
set_pev_string(iPlayer, pev_weaponmodel2, iszPlayerModel)
}
return HAM_IGNORED;
}
public OnDeploySg(const iItem)
{
new iPlayer
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
static iszViewModel;
if (iszViewModel || (iszViewModel = engfunc(EngFunc_AllocString, SMOKE_VIEW_MODEL)))
{
set_pev_string(iPlayer, pev_viewmodel2, iszViewModel)
}
static iszPlayerModel;
if (iszPlayerModel || (iszPlayerModel = engfunc(EngFunc_AllocString, SMOKE_PLAYER_MODEL)))
{
set_pev_string(iPlayer, pev_weaponmodel2, iszPlayerModel)
}
return HAM_IGNORED;
}
public FakeMeta_SetModel(const iEntity, const szModel[])
{
if(!pev_valid(iEntity)) return FMRES_IGNORED
for(new i = 0; i < Models; i++)
{
if(equali(szModel,OldWorldModels))
{
SET_MODEL(iEntity, NewWorldModels)
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
public FwdEmitSound( iOrigEnt, iChannel, const szSample[], Float:fVol, Float:fAttn, iFlags, iPitch )
{
static const szSmokeSound[] = "weapons/sg_explode.wav"
if( equal( szSample, szSmokeSound ) )
{
// cache origin, angles and model
new Float:vOrigin[ 3 ], Float:vAngles[ 3 ], szModel[ 64 ]
entity_get_vector( iOrigEnt, EV_VEC_origin, vOrigin )
entity_get_vector( iOrigEnt, EV_VEC_angles, vAngles )
entity_get_string( iOrigEnt, EV_SZ_model, szModel, charsmax( szModel ) )
// remove entity from world
entity_set_vector( iOrigEnt, EV_VEC_origin, Float:{ 9999.9, 9999.9, 9999.9 } )
entity_set_int( iOrigEnt, EV_INT_flags, FL_KILLME )
// create new entity
new iEntity = create_entity( "info_target" )
if( iEntity > 0 )
{
entity_set_string( iEntity, EV_SZ_classname, g_szClassname )
entity_set_origin( iEntity, vOrigin )
entity_set_vector( iEntity, EV_VEC_angles, vAngles )
entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_TOSS )
entity_set_int( iEntity, EV_INT_solid, SOLID_BBOX )
entity_set_float( iEntity, EV_FL_nextthink, get_gametime( ) + 21.5 )
entity_set_float( iEntity, EV_FL_gravity, 0.5 )
entity_set_float( iEntity, EV_FL_friction, 0.8 )
entity_set_model( iEntity, szModel )
new Float:vVelocity[ 3 ]
vVelocity[ 0 ] = random_float( -220.0, 220.0 )
vVelocity[ 1 ] = random_float( -220.0, 220.0 )
vVelocity[ 2 ] = random_float( 200.0, 300.0 )
entity_set_vector( iEntity, EV_VEC_velocity, vVelocity )
emit_sound( iEntity, iChannel, szSample, fVol, fAttn, iFlags, iPitch )
// Store the smoke number in entity, we will use it later
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_FIREFIELD )
engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] + 50 )
write_short( 100 )
write_short( g_szSmokeSprite )
write_byte( 100 )
write_byte( TEFIRE_FLAG_ALPHA )
write_byte( 1000 )
message_end()
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_FIREFIELD )
engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] + 50 )
write_short( 150 )
write_short( g_szSmokeSprite )
write_byte( 10 )
write_byte( TEFIRE_FLAG_ALPHA | TEFIRE_FLAG_SOMEFLOAT )
write_byte( 1000 )
message_end( )
}
}
}
public FwdTouch_FakeSmoke( const iEntity, iWorld )
{
if( !is_valid_ent( iEntity ) ) return PLUGIN_CONTINUE
// Bounce sound
emit_sound( iEntity, CHAN_VOICE, "weapons/grenade_hit1.wav", 0.25, ATTN_NORM, 0, PITCH_NORM )
new Float:vVelocity[ 3 ]
entity_get_vector( iEntity, EV_VEC_velocity, vVelocity )
if( vVelocity[ 1 ] <= 0.0 && vVelocity[ 2 ] <= 0.0 )
{
new Float:vOrigin[ 3 ]
entity_get_vector( iEntity, EV_VEC_origin, vOrigin )
// Make small smoke near grenade on ground
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_FIREFIELD )
engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] + 10 )
write_short( 2 )
write_short( g_szSmokeSprite )
write_byte( 2 )
write_byte( TEFIRE_FLAG_ALLFLOAT | TEFIRE_FLAG_ALPHA )
write_byte( 30 )
message_end()
}
return PLUGIN_CONTINUE
}
public FwdThink_FakeSmoke( const iEntity )
{
if( !is_valid_ent( iEntity ) ) return PLUGIN_CONTINUE;
remove_entity( iEntity )
return PLUGIN_CONTINUE;
}
public cmdBlockSound(id)
{
gBlockSound[id] ^= 1
client_print_color(id, 0, "^1[^4CS:GO^1] Звуки гранат ^3%s^1.", gBlockSound[id]/** == 0**/ ? "Выкл" : "Вкл")
}
public Message_TextMsg(iMesgId, iMsgType, iMsgEnt)
{
#define PRINT_RADIO 5
#define SENDER_ID 2
if(get_msg_arg_int(1) != PRINT_RADIO)
return PLUGIN_CONTINUE
static Text[32]
get_msg_arg_string(PRINT_RADIO, Text, charsmax(Text))
if(equal(Text, "#Fire_in_the_hole"))
{
static Sender[4], SenderId, szSound[MAX_SOUND_PATH_LENGTH]
get_msg_arg_string(SENDER_ID, Sender, charsmax(Sender))
SenderId = str_to_num(Sender)
switch(get_user_weapon(SenderId))
{
case CSW_HEGRENADE: szSound = SOUND_HEGREN
case CSW_SMOKEGRENADE: szSound = SOUND_SMOKE
case CSW_FLASHBANG: szSound = SOUND_FLASH
default: szSound = "radio/ct_fireinhole.wav"
}
#if defined REAL_RADIO
if(!gBlockSound[SenderId]) emit_sound(SenderId, CHAN_VOICE, szSound, VOL_NORM, ATTN_STATIC, 0, PITCH_NORM)
#else
new Players[32], iNum, szTeam[10], Player
get_user_team(SenderId, szTeam, charsmax(szTeam))
get_players(Players, iNum, "ce", szTeam)
for(new i = 0; i < iNum; ++i)
{
Player = Players
if(!gBlockSound[Player]) SendAudio(Player, szSound)
}
#endif
BlockAudio(iMsgEnt)
#if defined BLOCK_FITH_TEXT
return PLUGIN_HANDLED
#endif
}
return PLUGIN_CONTINUE
}
PrecacheModels()
{
for(new i; i < Models; i++)
{
PRECACHE_MODEL(NewViewModels)
PRECACHE_MODEL(NewWorldModels)
PRECACHE_MODEL(NewPlayerModels)
}
}
PrecacheSounds()
{
precache_sound(SOUND_SMOKE)
precache_sound(SOUND_FLASH)
precache_sound(SOUND_HEGREN)
precache_sound("radio/ct_fireinhole.wav")
}
bool: CheckItem(const iItem, &iPlayer)
{
if (!IsValidPev(iItem))
{
return false;
}
iPlayer = get_pdata_cbase(iItem, m_pPlayer, extra_offset_weapon)
if (!IsValidPev(iPlayer) || !BitCheck(g_bitIsConnected, iPlayer))
{
return false
}
return true
}
stock SendAudio(id, const szSound[])
{
message_begin(MSG_ONE, gMsgIdSendAudio, .player=id)
write_byte(id)
write_string(szSound)
write_short(PITCH_NORM)
message_end()
}
// by VEN
stock BlockAudio(id)
{
message_begin(MSG_ONE, gMsgIdSendAudio, .player=id)
write_byte(0)
write_string("%!MRAD_")
write_short(32767)
message_end()
}
// vk.com/good_plugins - сборки серверов, плагины, модели, карты и т.д.
// #define REAL_RADIO // Отключить озвучку CS:GO - закомментируйте.
#define BLOCK_FITH_TEXT // Блокирует сообщение "Fire in the hole!".
new const SOUND_SMOKE[] = "grenade_mode/smoke.wav"
new const SOUND_FLASH[] = "grenade_mode/flash.wav"
new const SOUND_HEGREN[] = "grenade_mode/he.wav"
#define GRENADE_VIEW_MODEL "models/grenade_mode/v_he.mdl"
#define GRENADE_WORLD_MODEL "models/grenade_mode/w_he.mdl"
#define GRENADE_PLAYER_MODEL "models/grenade_mode/p_he.mdl"
#define SMOKE_VIEW_MODEL "models/grenade_mode/v_smoke.mdl"
#define SMOKE_WORLD_MODEL "models/grenade_mode/w_smoke.mdl"
#define SMOKE_PLAYER_MODEL "models/grenade_mode/p_smoke.mdl"
#define FLASH_VIEW_MODEL "models/grenade_mode/v_flash.mdl"
#define FLASH_WORLD_MODEL "models/grenade_mode/w_flash.mdl"
#define FLASH_PLAYER_MODEL "models/grenade_mode/p_flash.mdl"
#define MAX_SOUND_PATH_LENGTH 32
#define MAXPLAYERS 32
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif
#define PRECACHE_MODEL(%0) engfunc(EngFunc_PrecacheModel, %0)
#define SET_MODEL(%0,%1) engfunc(EngFunc_SetModel, %0, %1)
#define IsValidPev(%0) (pev_valid(%0) == 2)
#define BitSet(%0,%1) (%0 |= (1 << (%1 - 1)))
#define BitClear(%0,%1) (%0 &= ~(1 << (%1 - 1)))
#define BitCheck(%0,%1) (%0 & (1 << (%1 - 1)))
#define m_pPlayer 41
#define extra_offset_weapon 4
enum _:Models
{
HE,
SG,
FB
}
new gMsgIdSendAudio
new gBlockSound[MAXPLAYERS + 1]
new const g_szClassname[] = "Smoke"
new const OldWorldModels[][] = { "models/w_hegrenade.mdl", "models/w_smokegrenade.mdl", "models/w_flashbang.mdl" }
new const NewViewModels[][] = { GRENADE_VIEW_MODEL, SMOKE_VIEW_MODEL, FLASH_VIEW_MODEL }
new const NewWorldModels[][] = { GRENADE_WORLD_MODEL, SMOKE_WORLD_MODEL, FLASH_WORLD_MODEL }
new const NewPlayerModels[][] = { GRENADE_PLAYER_MODEL, SMOKE_PLAYER_MODEL, FLASH_PLAYER_MODEL }
new g_bitIsConnected
new g_szSmokeSprite
public plugin_precache()
{
PrecacheModels()
PrecacheSounds()
g_szSmokeSprite = precache_model( "sprites/grenade_mode/smoke.spr" )
}
public plugin_init()
{
register_plugin("Grenade Mode", "0.6", "gyxoBka")
register_clcmd("say /gs", "cmdBlockSound")
register_clcmd("say_team /gs", "cmdBlockSound")
register_touch( g_szClassname, "worldspawn", "FwdTouch_FakeSmoke" )
register_think( g_szClassname, "FwdThink_FakeSmoke" )
register_forward( FM_EmitSound, "FwdEmitSound" )
RegisterHam(Ham_Item_Deploy, "weapon_hegrenade", "OnDeployHe", true)
RegisterHam(Ham_Item_Deploy, "weapon_flashbang", "OnDeployFb", true)
RegisterHam(Ham_Item_Deploy, "weapon_smokegrenade", "OnDeploySg", true)
register_forward(FM_SetModel, "FakeMeta_SetModel", false)
register_message(get_user_msgid("TextMsg"), "Message_TextMsg")
gMsgIdSendAudio = get_user_msgid("SendAudio")
}
public client_putinserver(id)
{
BitSet(g_bitIsConnected, id);
gBlockSound[id] = 0
}
#if AMXX_VERSION_NUM < 183
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
BitClear(g_bitIsConnected, id)
}
public OnDeployHe(const iItem)
{
new iPlayer
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
static iszViewModel;
if (iszViewModel || (iszViewModel = engfunc(EngFunc_AllocString, GRENADE_VIEW_MODEL)))
{
set_pev_string(iPlayer, pev_viewmodel2, iszViewModel)
}
static iszPlayerModel;
if (iszPlayerModel || (iszPlayerModel = engfunc(EngFunc_AllocString, GRENADE_PLAYER_MODEL)))
{
set_pev_string(iPlayer, pev_weaponmodel2, iszPlayerModel)
}
return HAM_IGNORED;
}
public OnDeployFb(const iItem)
{
new iPlayer
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
static iszViewModel;
if (iszViewModel || (iszViewModel = engfunc(EngFunc_AllocString, FLASH_VIEW_MODEL)))
{
set_pev_string(iPlayer, pev_viewmodel2, iszViewModel)
}
static iszPlayerModel;
if (iszPlayerModel || (iszPlayerModel = engfunc(EngFunc_AllocString, FLASH_PLAYER_MODEL)))
{
set_pev_string(iPlayer, pev_weaponmodel2, iszPlayerModel)
}
return HAM_IGNORED;
}
public OnDeploySg(const iItem)
{
new iPlayer
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
static iszViewModel;
if (iszViewModel || (iszViewModel = engfunc(EngFunc_AllocString, SMOKE_VIEW_MODEL)))
{
set_pev_string(iPlayer, pev_viewmodel2, iszViewModel)
}
static iszPlayerModel;
if (iszPlayerModel || (iszPlayerModel = engfunc(EngFunc_AllocString, SMOKE_PLAYER_MODEL)))
{
set_pev_string(iPlayer, pev_weaponmodel2, iszPlayerModel)
}
return HAM_IGNORED;
}
public FakeMeta_SetModel(const iEntity, const szModel[])
{
if(!pev_valid(iEntity)) return FMRES_IGNORED
for(new i = 0; i < Models; i++)
{
if(equali(szModel,OldWorldModels))
{
SET_MODEL(iEntity, NewWorldModels)
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
public FwdEmitSound( iOrigEnt, iChannel, const szSample[], Float:fVol, Float:fAttn, iFlags, iPitch )
{
static const szSmokeSound[] = "weapons/sg_explode.wav"
if( equal( szSample, szSmokeSound ) )
{
// cache origin, angles and model
new Float:vOrigin[ 3 ], Float:vAngles[ 3 ], szModel[ 64 ]
entity_get_vector( iOrigEnt, EV_VEC_origin, vOrigin )
entity_get_vector( iOrigEnt, EV_VEC_angles, vAngles )
entity_get_string( iOrigEnt, EV_SZ_model, szModel, charsmax( szModel ) )
// remove entity from world
entity_set_vector( iOrigEnt, EV_VEC_origin, Float:{ 9999.9, 9999.9, 9999.9 } )
entity_set_int( iOrigEnt, EV_INT_flags, FL_KILLME )
// create new entity
new iEntity = create_entity( "info_target" )
if( iEntity > 0 )
{
entity_set_string( iEntity, EV_SZ_classname, g_szClassname )
entity_set_origin( iEntity, vOrigin )
entity_set_vector( iEntity, EV_VEC_angles, vAngles )
entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_TOSS )
entity_set_int( iEntity, EV_INT_solid, SOLID_BBOX )
entity_set_float( iEntity, EV_FL_nextthink, get_gametime( ) + 21.5 )
entity_set_float( iEntity, EV_FL_gravity, 0.5 )
entity_set_float( iEntity, EV_FL_friction, 0.8 )
entity_set_model( iEntity, szModel )
new Float:vVelocity[ 3 ]
vVelocity[ 0 ] = random_float( -220.0, 220.0 )
vVelocity[ 1 ] = random_float( -220.0, 220.0 )
vVelocity[ 2 ] = random_float( 200.0, 300.0 )
entity_set_vector( iEntity, EV_VEC_velocity, vVelocity )
emit_sound( iEntity, iChannel, szSample, fVol, fAttn, iFlags, iPitch )
// Store the smoke number in entity, we will use it later
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_FIREFIELD )
engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] + 50 )
write_short( 100 )
write_short( g_szSmokeSprite )
write_byte( 100 )
write_byte( TEFIRE_FLAG_ALPHA )
write_byte( 1000 )
message_end()
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_FIREFIELD )
engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] + 50 )
write_short( 150 )
write_short( g_szSmokeSprite )
write_byte( 10 )
write_byte( TEFIRE_FLAG_ALPHA | TEFIRE_FLAG_SOMEFLOAT )
write_byte( 1000 )
message_end( )
}
}
}
public FwdTouch_FakeSmoke( const iEntity, iWorld )
{
if( !is_valid_ent( iEntity ) ) return PLUGIN_CONTINUE
// Bounce sound
emit_sound( iEntity, CHAN_VOICE, "weapons/grenade_hit1.wav", 0.25, ATTN_NORM, 0, PITCH_NORM )
new Float:vVelocity[ 3 ]
entity_get_vector( iEntity, EV_VEC_velocity, vVelocity )
if( vVelocity[ 1 ] <= 0.0 && vVelocity[ 2 ] <= 0.0 )
{
new Float:vOrigin[ 3 ]
entity_get_vector( iEntity, EV_VEC_origin, vOrigin )
// Make small smoke near grenade on ground
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_FIREFIELD )
engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] )
engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] + 10 )
write_short( 2 )
write_short( g_szSmokeSprite )
write_byte( 2 )
write_byte( TEFIRE_FLAG_ALLFLOAT | TEFIRE_FLAG_ALPHA )
write_byte( 30 )
message_end()
}
return PLUGIN_CONTINUE
}
public FwdThink_FakeSmoke( const iEntity )
{
if( !is_valid_ent( iEntity ) ) return PLUGIN_CONTINUE;
remove_entity( iEntity )
return PLUGIN_CONTINUE;
}
public cmdBlockSound(id)
{
gBlockSound[id] ^= 1
client_print_color(id, 0, "^1[^4CS:GO^1] Звуки гранат ^3%s^1.", gBlockSound[id]/** == 0**/ ? "Выкл" : "Вкл")
}
public Message_TextMsg(iMesgId, iMsgType, iMsgEnt)
{
#define PRINT_RADIO 5
#define SENDER_ID 2
if(get_msg_arg_int(1) != PRINT_RADIO)
return PLUGIN_CONTINUE
static Text[32]
get_msg_arg_string(PRINT_RADIO, Text, charsmax(Text))
if(equal(Text, "#Fire_in_the_hole"))
{
static Sender[4], SenderId, szSound[MAX_SOUND_PATH_LENGTH]
get_msg_arg_string(SENDER_ID, Sender, charsmax(Sender))
SenderId = str_to_num(Sender)
switch(get_user_weapon(SenderId))
{
case CSW_HEGRENADE: szSound = SOUND_HEGREN
case CSW_SMOKEGRENADE: szSound = SOUND_SMOKE
case CSW_FLASHBANG: szSound = SOUND_FLASH
default: szSound = "radio/ct_fireinhole.wav"
}
#if defined REAL_RADIO
if(!gBlockSound[SenderId]) emit_sound(SenderId, CHAN_VOICE, szSound, VOL_NORM, ATTN_STATIC, 0, PITCH_NORM)
#else
new Players[32], iNum, szTeam[10], Player
get_user_team(SenderId, szTeam, charsmax(szTeam))
get_players(Players, iNum, "ce", szTeam)
for(new i = 0; i < iNum; ++i)
{
Player = Players
if(!gBlockSound[Player]) SendAudio(Player, szSound)
}
#endif
BlockAudio(iMsgEnt)
#if defined BLOCK_FITH_TEXT
return PLUGIN_HANDLED
#endif
}
return PLUGIN_CONTINUE
}
PrecacheModels()
{
for(new i; i < Models; i++)
{
PRECACHE_MODEL(NewViewModels)
PRECACHE_MODEL(NewWorldModels)
PRECACHE_MODEL(NewPlayerModels)
}
}
PrecacheSounds()
{
precache_sound(SOUND_SMOKE)
precache_sound(SOUND_FLASH)
precache_sound(SOUND_HEGREN)
precache_sound("radio/ct_fireinhole.wav")
}
bool: CheckItem(const iItem, &iPlayer)
{
if (!IsValidPev(iItem))
{
return false;
}
iPlayer = get_pdata_cbase(iItem, m_pPlayer, extra_offset_weapon)
if (!IsValidPev(iPlayer) || !BitCheck(g_bitIsConnected, iPlayer))
{
return false
}
return true
}
stock SendAudio(id, const szSound[])
{
message_begin(MSG_ONE, gMsgIdSendAudio, .player=id)
write_byte(id)
write_string(szSound)
write_short(PITCH_NORM)
message_end()
}
// by VEN
stock BlockAudio(id)
{
message_begin(MSG_ONE, gMsgIdSendAudio, .player=id)
write_byte(0)
write_string("%!MRAD_")
write_short(32767)
message_end()
}
И ещё вопрос на засыпку:
В подобных плагинах, при раскрывании дыма в конце раунда, в новом раунде он остаётся.. это как-нибудь реально пофиксить ? Это, кстати, очень важный вопросец)
Спасибо.
Вложения
-
11 KB Просмотры: 11