Raised This Month: $32 Target: $400
 8% 

some engfunc help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rolnaaba
Veteran Member
Join Date: May 2006
Old 11-30-2006 , 14:05   some engfunc help
Reply With Quote #1

this code:
Code:
#include <amxmodx> #include <fakemeta> new rep_Planted[] = "sounds/JingleBell.mp3" new rep_Defused[] = "sounds/Laugh.mp3" new game_Planted[5][] = {        "weapons/c4_beep1.wav",     "weapons/c4_beep2.wav",     "weapons/c4_beep3.wav",     "weapons/c4_beep4.wav",     "weapons/c4_beep5.wav" } new game_Defused[] = "weapons/c4_disarm.wav" public plugin_init() {     register_forward(FM_EmitSound, "replace_sound"); } public replace_sound(ent, channel, const sound[]) {         if(equali(sound, game_Defused)) {         engfunc(EngFunc_EmitSound,ent,rep_Defused);         return FMRES_SUPERCEDE;     }     else {         new listsize = sizeof game_Planted                 for(new i; i<listsize; i++) {             if(equali(sound, game_Planted[i])) {                 engfunc(EngFunc_EmitSound,ent,rep_Planted);                 return FMRES_SUPERCEDE;             }         }     }     return FMRES_IGNORED; }

crashes the client with this error message:
Code:
 
EMIT_SOUND:VOLUME=0
why lol and how to fix if possible plz
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-30-2006 , 14:13   Re: some engfunc help
Reply With Quote #2

You should learn the basics first, read the fakemeta_const.inc.

EmitSound should be called with the prototype:
Quote:
(edict_t *entity, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch)
VEN is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 11-30-2006 , 14:13   Re: some engfunc help
Reply With Quote #3

Code:
engfunc(EngFunc_EmitSound, index, channel, sample[], Float:vol, Float:att,flags, pitch) // this should work AFAIK

edit: Hello VEN
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 12-01-2006 , 10:59   Re: some engfunc help
Reply With Quote #4

omg I am so retarded I am sry, what are max/min values of Float:vol?

[EDIT] think this will work...
Code:
#include <amxmodx> #include <fakemeta> new rep_Planted[] = "sounds/JingleBell.mp3" new rep_Defused[] = "sounds/Laugh.mp3" new game_Planted[5][] = {        "weapons/c4_beep1.wav",     "weapons/c4_beep2.wav",     "weapons/c4_beep3.wav",     "weapons/c4_beep4.wav",     "weapons/c4_beep5.wav" } new game_Defused[] = "weapons/c4_disarm.wav" public plugin_init() {     register_forward(FM_EmitSound, "fw_replace_sound"); } public fw_replace_sound(ent, channel, const sound[], Float:volume,Float:attenuation, flags, pitch) {     if(equali(sound, game_Defused)) {         engfunc(EngFunc_EmitSound,ent,channel,rep_Defused,volume,attenuation,flags,pitch);         return FMRES_SUPERCEDE;     }     else {         new listsize = sizeof game_Planted                 for(new i; i<listsize; i++) {             if(equali(sound, game_Planted[i])) {                 engfunc(EngFunc_EmitSound,ent,channel,rep_Planted,volume,attenuation,flags,pitch);                 return FMRES_SUPERCEDE;             }         }     }     return FMRES_IGNORED }
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 12-01-2006 at 11:18.
Rolnaaba is offline
Old 12-01-2006, 11:06
Rolnaaba
This message has been deleted by Rolnaaba.
Rolnaaba
Veteran Member
Join Date: May 2006
Old 12-01-2006 , 13:15   Re: some engfunc help
Reply With Quote #5

they said it not working still...not sure whats wrong
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 12-01-2006 , 13:27   Re: some engfunc help
Reply With Quote #6

is weapons/c4_disarm.wav emited?
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 12-01-2006 , 13:45   Re: some engfunc help
Reply With Quote #7

pretty sure thats the default sound...
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 12-01-2006 , 14:12   Re: some engfunc help
Reply With Quote #8

you cant emit mp3 sound as far as i know
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-01-2006 , 14:28   Re: some engfunc help
Reply With Quote #9

Good catch, P34nut
VEN is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 12-01-2006 , 19:05   Re: some engfunc help
Reply With Quote #10

ahh so I how would I play an mp3 sound from that ent (bomb) that I am trying to do?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Reply


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 02:20.


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