Raised This Month: $ Target: $400
 0% 

no death sound?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
algee2005
Member
Join Date: Jul 2005
Location: Germany
Old 08-23-2005 , 05:59   no death sound?
Reply With Quote #1

well, im trying to make a plugin and i need to avoid the death sound only when a specific person dies, is this possible?

http://forums.alliedmods.net/showthread.php?t=16684
__________________
L 10/16/1982 - 01:23:00: FATAL ERROR (shutting down): Mod_LoadBrushModel: models/algee_born.mdl too sexy
algee2005 is offline
Send a message via ICQ to algee2005 Send a message via AIM to algee2005 Send a message via MSN to algee2005 Send a message via Yahoo to algee2005
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-23-2005 , 16:20  
Reply With Quote #2

Code:
 #include <amxmodx>  #include <fakemeta>  public plugin_init() {     register_forward(FM_EmitSound,"fw_emitsound",0);  }  public fw_emitsound(ent,channel,sample[],Float:volume,Float:atten,flags,pitch) {     if(!is_user_connected(ent)) {         return FMRES_IGNORED;     }     // additional if statement here to see     // if this user's death should NOT be blocked     if(something) {         return FMRES_IGNORED;     }     if(containi(sample,"player/die") != -1 || containi(sample,"player/death") != -1) {         return FMRES_SUPERCEDE;     }     return FMRES_IGNORED;  }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
algee2005
Member
Join Date: Jul 2005
Location: Germany
Old 08-24-2005 , 07:29  
Reply With Quote #3

thx alot for your help

but it didnt work for me, i must do something wrong

this is my attempt:

Code:
new bool:stealth[32] public plugin_init()    {    register_forward(FM_EmitSound,"forward_EmitSound",0);    } public client_putinserver(id)    {    if(is_user_admin(id)) stealth[id]=true    } public forward_EmitSound(ent,channel,sample[],Float:volume,Float:atten,flags,pitch)    {    if(!is_user_connected(ent))       {       return FMRES_IGNORED;       }    if(stealth[ent])       {       return FMRES_IGNORED;       }    if(containi(sample,"player/die") != -1 || containi(sample,"player/death") != -1)       {       return FMRES_SUPERCEDE;       }    return FMRES_IGNORED;    }

something like this should work, no?
that should make admins cause no death sound when they die...

but i can still hear death sound when i die
maybe you can look into this again and tell me what im doing wrong?
__________________
L 10/16/1982 - 01:23:00: FATAL ERROR (shutting down): Mod_LoadBrushModel: models/algee_born.mdl too sexy
algee2005 is offline
Send a message via ICQ to algee2005 Send a message via AIM to algee2005 Send a message via MSN to algee2005 Send a message via Yahoo to algee2005
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-24-2005 , 14:54  
Reply With Quote #4

a) Your variable should be size 33, not 32

b)
Code:
   if(stealth[ent])       {       return FMRES_IGNORED;       }
That means if they have stealth then it will play the sound anyway, change the if to "!stealth[ent]"
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
algee2005
Member
Join Date: Jul 2005
Location: Germany
Old 08-25-2005 , 05:55  
Reply With Quote #5

then i must have got the comment wrong there..

Code:
if(!is_user_connected(ent))    {    return FMRES_IGNORED;    } // additional if statement here to see // if this user's death should NOT be blocked if(something)    {    return FMRES_IGNORED;    }

so, it would also play the sound when the user is not connected anymore?




but -- i thought 32 is just the definition of size - the players id would go from 0 to 31, so having 32 possible players, no?
__________________
L 10/16/1982 - 01:23:00: FATAL ERROR (shutting down): Mod_LoadBrushModel: models/algee_born.mdl too sexy
algee2005 is offline
Send a message via ICQ to algee2005 Send a message via AIM to algee2005 Send a message via MSN to algee2005 Send a message via Yahoo to algee2005
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-25-2005 , 15:50  
Reply With Quote #6

Yes, you got the comment wrong, I said if their death should NOT be blocked, if stealth[id] is true it SHOULD be blocked, so instead you have to check for !stealth[id].

Also, players go from 1 to 32, an array of size 32 has a max index number of 31.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
algee2005
Member
Join Date: Jul 2005
Location: Germany
Old 08-25-2005 , 18:09  
Reply With Quote #7

ok, i will do the ! thingy.

Quote:
Originally Posted by XxAvalanchexX
Also, players go from 1 to 32, an array of size 32 has a max index number of 31.
wow, never knew that, i will have to go and fix alot of stuff then... thx for telling me

EDIT: oooh forgot the karma up fixed now
__________________
L 10/16/1982 - 01:23:00: FATAL ERROR (shutting down): Mod_LoadBrushModel: models/algee_born.mdl too sexy
algee2005 is offline
Send a message via ICQ to algee2005 Send a message via AIM to algee2005 Send a message via MSN to algee2005 Send a message via Yahoo to algee2005
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 14:33.


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