Raised This Month: $ Target: $400
 0% 

no sounds are played


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
anakonda001
Member
Join Date: Jul 2020
Old 07-05-2020 , 16:57   no sounds are played
Reply With Quote #1

help guys, sounds are not played, downloaded but not played in the game, what is wrong with the plugin?
Code:
#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);
}
anakonda001 is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode