Raised This Month: $51 Target: $400
 12% 

no sounds are played


Post New Thread Reply   
 
Thread Tools Display Modes
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
anakonda001
Member
Join Date: Jul 2020
Old 07-06-2020 , 06:36   Re: no sounds are played
Reply With Quote #2

help please
anakonda001 is offline
Old 07-06-2020, 07:30
supertrio17
This message has been deleted by supertrio17. Reason: nvm
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 07-06-2020 , 07:45   Re: no sounds are played
Reply With Quote #3

Code:
new const PickedUpTheBomb[] = "PickedUpTheBomb.wav" //
File path is missing.
__________________

Last edited by DJEarthQuake; 07-06-2020 at 13:06. Reason: Obvious typo.
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-06-2020 , 08:48   Re: no sounds are played
Reply With Quote #4

Quote:
Originally Posted by DJEarthQuake View Post
Full directory path is not showing in the script.
IE| "sound/misc/PickedUpTheBomb.wav"
The "sound" directory is not needed when precaching.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
anakonda001
Member
Join Date: Jul 2020
Old 07-06-2020 , 13:41   Re: no sounds are played
Reply With Quote #5

Quote:
Originally Posted by DJEarthQuake View Post
Code:
new const PickedUpTheBomb[] = "PickedUpTheBomb.wav" //
File path is missing.
I spelled out the path there, the name of the sound, but it doesn't play
anakonda001 is offline
anakonda001
Member
Join Date: Jul 2020
Old 07-06-2020 , 13:43   Re: no sounds are played
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
The "sound" directory is not needed when precaching.
I do not understand you, I need to prescribe this path to the sound " sound / misc/
anakonda001 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 07-06-2020 , 13:43   Re: no sounds are played
Reply With Quote #7

The files are in the sound folder?
__________________
DJEarthQuake is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 07-06-2020 , 13:46   Re: no sounds are played
Reply With Quote #8

Quote:
Originally Posted by anakonda001 View Post
I do not understand you, I need to prescribe this path to the sound " sound / misc/
He's right. I truncated what I originally had and should have left it early this morning. Everything is relative to the sound directory using precache_sound.

https://www.amxmodx.org/api/amxmodx/precache_sound
__________________

Last edited by DJEarthQuake; 07-06-2020 at 13:46.
DJEarthQuake is offline
anakonda001
Member
Join Date: Jul 2020
Old 07-06-2020 , 13:54   Re: no sounds are played
Reply With Quote #9

Quote:
Originally Posted by DJEarthQuake View Post
The files are in the sound folder?
yes
anakonda001 is offline
anakonda001
Member
Join Date: Jul 2020
Old 07-06-2020 , 13:56   Re: no sounds are played
Reply With Quote #10

Quote:
Originally Posted by DJEarthQuake View Post
He's right. I truncated what I originally had and should have left it early this morning. Everything is relative to the sound directory using precache_sound.

https://www.amxmodx.org/api/amxmodx/precache_sound
so what should I do?
anakonda001 is offline
Reply



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 15:59.


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