Raised This Month: $ Target: $400
 0% 

allow user to set whether they hear a sound..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 06-27-2009 , 22:43   allow user to set whether they hear a sound..
Reply With Quote #1

im making my very first plugin, its quite a simple plugin.. it will play a sound when a user dies... but if you die ALOT it can get VERY annoying, so im trying to make a command that will stop the plugin from working for that client.. I dont know how to do this though

heres my source, can someone help me?

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

#include <amxmodx>
#include <amxmisc>
#include <HamSandwich>

#define PLUGIN    "Death Noise"
#define AUTHOR    "HLM A.K.A Master"
#define VERSION    "1.0"



public plugin_init()
{
register_plugin(PLUGINVERSIONAUTHOR)
RegisterHam(Ham_Killed"player" "ham_player_killed"1)
register_clcmd("amx_deathmsg","blocksounds",_,"Enables/Disables the death sound")
}

public 
plugin_precache()
{
precache_sound("misc/Terminated.wav")
}

public 
blocksounds(id)
{
    new 
arg[5]
    
read_argv(1,arg,4)
    
    new 
name[33]
    
get_user_name(id,name,32)
    
    if( 
equal(arg"off"))
    {
        
client_print(id,print_chat"[AMXX] %s, you will no longer hear the sound on death. "name)
        return 
PLUGIN_HANDLED
    
}
    else if( 
equal(arg"on"))
    {
        
client_print(id,print_chat"[AMXX] %s, you will hear the sound on death. ",name)
        return 
PLUGIN_CONTINUE
    
}
}

public 
ham_player_killed(id)
{

new 
name[33]
get_user_name(id,name,32)

client_cmd(id"speak misc/Terminated.wav")
return 
HAM_HANDLED

__________________
+|- KARMA Respectively


Last edited by HLM; 06-29-2009 at 20:14.
HLM is offline
 



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:41.


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