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

Silent shooting - command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
F0RCE
Senior Member
Join Date: Oct 2010
Old 01-04-2013 , 15:48   Silent shooting - command
Reply With Quote #1

Hello, I found a really nice plugin.
This video show how it works : http://www.youtube.com/watch?v=-YrRx...layer_embedded

It is making the sound of guns silent (You can hear only Your sounds)
And here is my request. I can't make it to work with command.
I want play to choose with command /silent or /mute.

PHP Code:
#pragma semicolon 0
#include <amxmisc>
#include <fakemeta>

new iEvents[] = {20,12,18,17,23,24,15,10,11,22,13,21,14,16,27,28,4,6,3,7,8,9,2,1,5}

public 
plugin_init() {
    
register_plugin("Blokujemy dzwieki""1.0""DarkGL")
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent");
}

public 
fwPlaybackEventflagsideventindex,FloatdelayFloatorigin[3], Floatangles[3], Floatfparam1Floatfparam2iparam1iparam2bparam1bparam2) {
    new 
bool:bFind false;
    
    for(new 
0;sizeof iEvents;i++){    
        if(
eventindex == iEvents[i]){
            
bFind true;
            break;
        }
    }
    
    if(!
bFind)    return FMRES_IGNORED;
    
    return 
FMRES_SUPERCEDE;

Thx for help!
F0RCE is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-04-2013 , 15:54   Re: Silent shooting - command
Reply With Quote #2

Try this:
PHP Code:
#pragma semicolon 0
#include <amxmisc>
#include <fakemeta>

new iEvents[] = {20,12,18,17,23,24,15,10,11,22,13,21,14,16,27,28,4,6,3,7,8,9,2,1,5}
new 
bool:g_silent[33];
public 
plugin_init() {
    
register_plugin("Blokujemy dzwieki""1.0""DarkGL")
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent");
    
register_clcmd("say /silent","cmd_silent");
}

public 
fwPlaybackEventflagsideventindex,FloatdelayFloat:  origin[3], Floatangles[3], Floatfparam1Floatfparam2iparam1,  iparam2bparam1bparam2) {
    if(!
g_silent[id]) return FMRES_IGNORED;
    new 
bool:bFind false;
    
    for(new 
0;sizeof iEvents;i++){    
        if(
eventindex == iEvents[i]){
            
bFind true;
            break;
        }
    }
    
    if(!
bFind)    return FMRES_IGNORED;
    
    return 
FMRES_SUPERCEDE;
}
public 
client_connect(id)
{
   
g_silent[id]=false;
}
public 
cmd_silent(id)
{
   
g_silent[id]=!g_silent[id];
   
client_print(id,print_chat,"You have set SOUND:%s",g_silent[id]?"[off]":"[on]");
   return 
PLUGIN_HANDLED;

__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-05-2013 at 10:13. Reason: g_silent[id]=!g_silent[id];
AngeIII is offline
Send a message via Skype™ to AngeIII
F0RCE
Senior Member
Join Date: Oct 2010
Old 01-04-2013 , 16:14   Re: Silent shooting - command
Reply With Quote #3

Nothing happen after typing that command.
Nothing show up in chat, sounds aren't muted

//It was not a bump it was another question...
If It's not possible, why should I wait 14days just to know that? not logical ;x

Last edited by F0RCE; 01-05-2013 at 09:36.
F0RCE is offline
Old 01-05-2013, 08:40
F0RCE
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-05-2013 , 10:40   Re: Silent shooting - command
Reply With Quote #4

i have tested and decided that when you write /silent for you no changes. BUT for others they will not hear you.

and also I miss "]"..
g_silent[id]=!g_silent[id];
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-05-2013 at 10:41.
AngeIII is offline
Send a message via Skype™ to AngeIII
F0RCE
Senior Member
Join Date: Oct 2010
Old 01-05-2013 , 12:52   Re: Silent shooting - command
Reply With Quote #5

But, isn't it possible to make it this way :

1 # I write /silent
2 # I can hear myself shooting, but not the others
F0RCE is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-05-2013 , 14:18   Re: Silent shooting - command
Reply With Quote #6

i think no, with this public fwPlaybackEvent( flags, id, eventindex,Float: delay, Float: origin[3], Float: angles[3], Float: fparam1, Float: fparam2, iparam1, iparam2, bparam1, bparam2)
forward impossible
you can try with orpheu module, to hook events from one players which is sended to others.
for example if you will find this forward with this params:
PHP Code:
event(sender,receiver)
{
  if(
g_silent[receiver]) return FM_SUPERCEDE;
  return 
FM_IGNORED;

__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-05-2013 at 14:21.
AngeIII is offline
Send a message via Skype™ to AngeIII
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 02:14.


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