Raised This Month: $ Target: $400
 0% 

no pickup sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-22-2008 , 07:46   no pickup sound
Reply With Quote #1

hi guys, i am trying to do a "no pickup sound" when u pickup a weapon... i used all code of SchlumPF* plugin .. (weapon utilitys) but the plugin dont work :S

PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <fakemeta>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

new g_iBlockSound[33];

new 
g_iCvar[1];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_iCvar[0] = register_cvar"weapons_blocksound""1" );
    
    
register_forwardFM_EmitSound"fwdEmitSound" );
}

public 
fwdEmitSoundplrchannel, const sound[] )
{        
    if( 
equalisound"items/gunpickup2.wav" ) )
    {
        if( 
get_pcvar_numg_iCvar[0] ) && g_iBlockSound[plr] )
        {
            
g_iBlockSound[plr]--;
            return 
FMRES_SUPERCEDE;
        }
        
        if( 
get_pcvar_numg_iCvar[0] ) == )
            return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
client_connectplr )
{
    
g_iBlockSound[plr] = 0;

what is wrong in the code?
Alucard^ is offline
Send a message via Skype™ to Alucard^
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 07-22-2008 , 09:32   Re: no pickup sound
Reply With Quote #2

i just use the variable g_iBlockSound to block the pickupsound just when somebody is using the /weapons cmd in my plugin which increases the value by one for each weapon the palyer gets. in fwdEmitSound() it checks whether the sound should be blocked or not.
any way this shoudl work for you:
PHP Code:
#include <amxmodx>
#include <fakemeta>

#pragma semicolon 1

#define PLUGIN "Block Weaponpickup Sound"
#define AUTHOR "SchlumPF"
#define VERSION "1.0"

new g_iCvar;

public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
g_iCvar register_cvar"weaponpickup_sound""1" );
    
register_forwardFM_EmitSound"fwdEmitSound_Pre");
}

public 
fwdEmitSound_Preplrchannel, const sound[] )
{        
    if( 
equalsound"items/gunpickup2.wav" ) )
    {
        if( 
get_pcvar_numg_iCvar ) )
        {
            return 
FMRES_SUPERCEDE;
        }
    }
    
    return 
FMRES_IGNORED;

__________________

Last edited by SchlumPF*; 07-22-2008 at 13:17.
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-22-2008 , 09:41   Re: no pickup sound
Reply With Quote #3

- equal would be enough
- Array for cvar is totaly useless here.

^^
__________________
Arkshine is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 07-22-2008 , 13:12   Re: no pickup sound
Reply With Quote #4

i know but i was to lazy to edit it ^^ i used a array in weapon_utility cuz i have about 3 cvars in it
+ is there any difference in cpu usage between equal and equali? usually i use equali even if equal woudl be enough
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-23-2008 , 00:57   Re: no pickup sound
Reply With Quote #5

oh, thx SchlumPF* & arkshine...

here a question..

Quote:
register_forward( FM_EmitSound, "fwdEmitSound_Pre", 0 );
where can i learn more about register_forward? tutorials or something?... becouse i dont have any idea of what is this..

i tried to search FM_EmitSound in functions (web amxmodx) and nothing... only the engine version EF_EmitSound ... all of these function i can see in the fakemeta utilitys by alka?

Last edited by Alucard^; 07-23-2008 at 01:01.
Alucard^ is offline
Send a message via Skype™ to Alucard^
{PHILMAGROIN}
Senior Member
Join Date: Aug 2007
Location: In the middle of the des
Old 07-23-2008 , 01:40   Re: no pickup sound
Reply With Quote #6

Quote:
Originally Posted by Alucard^ View Post
oh, thx SchlumPF* & arkshine...

here a question..

where can i learn more about register_forward? tutorials or something?... becouse i dont have any idea of what is this..
http://www.amxmodx.org/funcwiki.php?go=func&id=615
__________________
[B]
{PHILMAGROIN} is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-23-2008 , 04:27   Re: no pickup sound
Reply With Quote #7

thx philmagroin, and where can i get a list of forwardTypes?
Alucard^ is offline
Send a message via Skype™ to Alucard^
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-23-2008 , 04:31   Re: no pickup sound
Reply With Quote #8

includes/fakemeta_const.inc
__________________
Arkshine is offline
Old 07-23-2008, 04:31
Arkshine
This message has been deleted by Arkshine. Reason: double-msg
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-25-2008 , 00:10   Re: no pickup sound
Reply With Quote #9

thx to much arkshine, and..

haha sry for a lot of question... but, i think this is the last question..

Quote:
"fwdEmitSound_Pre"
the cellback, where can i see a list of this? or, what is this?
Alucard^ is offline
Send a message via Skype™ to Alucard^
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-25-2008 , 01:01   Re: no pickup sound
Reply With Quote #10

'cellback' ? What's this ?
__________________
Arkshine 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 05:35.


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