#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new g_Enable;
new g_bwEnt[33];
new g_CachedStringInfoTarget;
public plugin_init() {
register_plugin( "Bomb Hat", "1.0", "Subb98" );
register_logevent("EventPickedUpTheBomb", 3, "2=Spawned_With_The_Bomb", "2=Got_The_Bomb");
register_logevent("EventDropTheBomb", 3, "2=Dropped_The_Bomb", "2=Planted_The_Bomb");
register_cvar("bomb_hat", "1.2", FCVAR_SERVER);
g_Enable = register_cvar("amx_bombhat", "1");
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawn");
RegisterHam(Ham_Killed, "player", "fwHamPlayerKilledPost", 1);
g_CachedStringInfoTarget = engfunc( EngFunc_AllocString, "info_target" );
}
public plugin_precache() {
precache_model("models/sombreroos.mdl");
}
public EventPickedUpTheBomb() {
new id = get_loguser_index();
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) & ~EF_NODRAW);
}
}
public EventDropTheBomb() {
new id = get_loguser_index();
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) | EF_NODRAW);
}
}
public fwHamPlayerSpawn( const player ) {
if ( get_pcvar_num( g_Enable ) && is_user_alive( player ) ) {
new iEnt = g_bwEnt[ player ];
if( !pev_valid( iEnt ) ) {
g_bwEnt[ player ] = iEnt = engfunc ( EngFunc_CreateNamedEntity, g_CachedStringInfoTarget );
set_pev( iEnt, pev_movetype, MOVETYPE_FOLLOW );
set_pev( iEnt, pev_aiment, player );
set_pev( iEnt, pev_effects, pev(iEnt, pev_effects) | EF_NODRAW);
engfunc( EngFunc_SetModel, iEnt, "models/sombreroos.mdl" );
}
else set_pev( iEnt, pev_effects, pev(iEnt, pev_effects) | EF_NODRAW);
}
}
public fwHamPlayerKilledPost(const id) {
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) | EF_NODRAW);
}
}
stock get_loguser_index() { // author: VEN
new loguser[80], name[32];
read_logargv(0, loguser, 79);
parse_loguser(loguser, name, 31);
return get_user_index(name);
}
public EventPickedUpTheBomb() {
new id = get_loguser_index();
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) & ~EF_NODRAW);
}
}
public EventDropTheBomb() {
new id = get_loguser_index();
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) | EF_NODRAW);
}
}
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new g_Enable;
new g_bwEnt[33];
new g_CachedStringInfoTarget;
new const DropTheBomb[] = "DropTheBomb.wav" // звук дропа
new const PickedUpTheBomb[] = "PickedUpTheBomb.wav" // звук поднятия
public plugin_init() {
register_plugin( "Bomb Hat", "1.0", "Subb98" );
register_logevent("EventPickedUpTheBomb", 3, "2=Spawned_With_The_Bomb", "2=Got_The_Bomb");
register_logevent("EventDropTheBomb", 3, "2=Dropped_The_Bomb", "2=Planted_The_Bomb");
register_cvar("bomb_hat", "1.2", FCVAR_SERVER);
g_Enable = register_cvar("amx_bombhat", "1");
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawn");
RegisterHam(Ham_Killed, "player", "fwHamPlayerKilledPost", 1);
g_CachedStringInfoTarget = engfunc( EngFunc_AllocString, "info_target" );
}
public plugin_precache() {
precache_model("models/sombreroos.mdl");
precache_sound(DropTheBomb)
precache_sound(PickedUpTheBomb)
}
public EventPickedUpTheBomb() {
new id = get_loguser_index();
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) & ~EF_NODRAW);
client_cmd(id, "spk %s", PickedUpTheBomb)
}
}
public EventDropTheBomb() {
new id = get_loguser_index();
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) | EF_NODRAW);
client_cmd(id, "spk %s", DropTheBomb)
}
}
public fwHamPlayerSpawn( const player ) {
if ( get_pcvar_num( g_Enable ) && is_user_alive( player ) ) {
new iEnt = g_bwEnt[ player ];
if( !pev_valid( iEnt ) ) {
g_bwEnt[ player ] = iEnt = engfunc ( EngFunc_CreateNamedEntity, g_CachedStringInfoTarget );
set_pev( iEnt, pev_movetype, MOVETYPE_FOLLOW );
set_pev( iEnt, pev_aiment, player );
set_pev( iEnt, pev_effects, pev(iEnt, pev_effects) | EF_NODRAW);
engfunc( EngFunc_SetModel, iEnt, "models/sombreroos.mdl" );
}
else set_pev( iEnt, pev_effects, pev(iEnt, pev_effects) | EF_NODRAW);
}
}
public fwHamPlayerKilledPost(const id) {
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) | EF_NODRAW);
}
}
stock get_loguser_index() { // author: VEN
new loguser[80], name[32];
read_logargv(0, loguser, 79);
parse_loguser(loguser, name, 31);
return get_user_index(name);
}
stock func_SendAudio( pPlayer, const szSample[ ] )
{
new g_iMsgSendAudio;
if( !g_iMsgSendAudio )
{
g_iMsgSendAudio = get_user_msgid( "SendAudio" );
}
message_begin( pPlayer ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, g_iMsgSendAudio, _, .player = pPlayer );
write_byte( pPlayer );
write_string( szSample );
write_short( PITCH_NORM );
message_end( );
}
-client_cmd(id, "spk %s", PickedUpTheBomb)
+func_SendAudio( id, PickedUpTheBomb );
-client_cmd(id, "spk %s", DropTheBomb)
+func_SendAudio( id, DropTheBomb );
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <reapi>
new g_Enable;
new g_bwEnt[33];
new g_CachedStringInfoTarget;
new const DropTheBomb[] = "DropTheBomb.wav" // звук дропа
new const PickedUpTheBomb[] = "PickedUpTheBomb.wav" // звук поднятия
public plugin_init() {
register_plugin( "Bomb Hat", "1.0", "Subb98" );
register_logevent("EventPickedUpTheBomb", 3, "2=Spawned_With_The_Bomb", "2=Got_The_Bomb");
register_logevent("EventDropTheBomb", 3, "2=Dropped_The_Bomb", "2=Planted_The_Bomb");
register_cvar("bomb_hat", "1.2", FCVAR_SERVER);
g_Enable = register_cvar("amx_bombhat", "1");
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawn");
RegisterHam(Ham_Killed, "player", "fwHamPlayerKilledPost", 1);
g_CachedStringInfoTarget = engfunc( EngFunc_AllocString, "info_target" );
}
public plugin_precache() {
precache_model("models/sombreroos.mdl");
precache_sound(DropTheBomb)
precache_sound(PickedUpTheBomb)
}
public EventPickedUpTheBomb() {
new id = get_loguser_index();
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) & ~EF_NODRAW);
rg_send_audio(id, fmt("sound/%s", PickedUpTheBomb));
}
}
public EventDropTheBomb() {
new id = get_loguser_index();
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) | EF_NODRAW);
rg_send_audio(id, fmt("sound/%s", DropTheBomb));
}
}
public fwHamPlayerSpawn( const player ) {
if ( get_pcvar_num( g_Enable ) && is_user_alive( player ) ) {
new iEnt = g_bwEnt[ player ];
if( !pev_valid( iEnt ) ) {
g_bwEnt[ player ] = iEnt = engfunc ( EngFunc_CreateNamedEntity, g_CachedStringInfoTarget );
set_pev( iEnt, pev_movetype, MOVETYPE_FOLLOW );
set_pev( iEnt, pev_aiment, player );
set_pev( iEnt, pev_effects, pev(iEnt, pev_effects) | EF_NODRAW);
engfunc( EngFunc_SetModel, iEnt, "models/sombreroos.mdl" );
}
else set_pev( iEnt, pev_effects, pev(iEnt, pev_effects) | EF_NODRAW);
}
}
public fwHamPlayerKilledPost(const id) {
if(pev_valid(g_bwEnt[id])) {
set_pev(g_bwEnt[id], pev_effects, pev(g_bwEnt[id], pev_effects) | EF_NODRAW);
}
}
stock get_loguser_index() { // author: VEN
new loguser[80], name[32];
read_logargv(0, loguser, 79);
parse_loguser(loguser, name, 31);
return get_user_index(name);
}