Raised This Month: $ Target: $400
 0% 

Plugin Not Reading


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
owned
Member
Join Date: Jul 2007
Old 07-26-2007 , 14:51   Re: Plugin Not Reading
Reply With Quote #1

I removed the cstrike addon, but now when it tries loading the sound I get:

Microsoft PCM Format Only


Also: update sma

PHP Code:
/*
* PLUGIN CREATED BY MARREC
* MARREC IS THE CO-OWNER OF FNM
* PLUGIN IS NOT TO BE RE-USED ON
*    ANY SERVER WITH OR WITH
*    OUT PERMISSION FROM
*    ANY BODY IN FNM
* ALL PLUGIN CONTENT IS 100%
*    HAND-CREATED, USING
*    NO HELP FROM ANOTHER
*    PLUGIN
*/

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "FnM Connect/Disconnect Sound and Print"
#define VERSION "1.0"
#define AUTHOR "MARREC"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /play1","play_sound1")
    
register_clcmd("say /play2","play_sound2")
    
register_clcmd("say /play3","play_sound3")
    
register_clcmd("say /play4","play_sound4")
    
}

public 
plugin_precache(){
    
precache_sound("fnm/welcome1.wav")
    
precache_sound("fnm/welcome2.wav")
    
precache_sound("fnm/leave1.wav")
    
precache_sound("fnm/leave2.wav")
}

public 
client_connect(id){
    
    if(
access(id,ADMIN_ADMIN)){
        new 
name[33], authID[33]
        
        
get_user_name(id,name,32)
        
get_user_authid(id,authID,32)
        
        
client_print(0,print_chat,">>> AN ADMIN HAS CONNECTED <<<")
        
client_print(0,print_chat,"Admin: %s [%s] has connected to FnM",name,authID)
    }else {
        new 
name[33],authID[33]
        
        
get_user_name(id,name,32)
        
get_user_authid(id,authID,32)
        
        
client_print(0,print_chat,">>> A NEW PLAYER HAS CONNECTED <<<")
        
client_print(0,print_chat,"Player: %s [%s] has connected to FnM",name,authID)
    }
    
    new 
sound_num random_num(1,2)
    
PlaySound(sound_num,1)
    
    return 
PLUGIN_CONTINUE

}

public 
client_disconnect(id){
    
    if(
access(id,ADMIN_ADMIN)){
        new 
name[33], authID[33]
        
        
get_user_name(id,name,32)
        
get_user_authid(id,authID,32)
        
        
client_print(0,print_chat,">>> AN ADMIN HAS DISNNECTED <<<")
        
client_print(0,print_chat,"Admin: %s [%s] has disconnected from FnM",name,authID)
    }else {
        new 
name[33],authID[33]
        
        
get_user_name(id,name,32)
        
get_user_authid(id,authID,32)
        
        
client_print(0,print_chat,">>> A PLAYER HAS DISCONNECTED <<<")
        
client_print(0,print_chat,"Player: %s [%s] has disconnected from FnM",name,authID)
    }
    
    new 
sound_num random_num(1,2)
    
PlaySound(sound_num,2)
    
    return 
PLUGIN_CONTINUE
}

public 
PlaySound(num,x){
    new 
num,x
    
if(== 1){
        switch(
num){
            case 
1emit_sound(0CHAN_VOICE"fnm/welcome1.wav"VOL_NORMATTN_NORM0PITCH_NORM)
            case 
2emit_sound(0CHAN_VOICE"fnm/welcome2.wav"VOL_NORMATTN_NORM0PITCH_NORM)
        }
    }

    
    if(
== 2){
        switch(
num){
            case 
1emit_sound(0CHAN_VOICE"fnm/leave1.wav"VOL_NORMATTN_NORM0PITCH_NORM)
            case 
2emit_sound(0CHAN_VOICE"fnm/leave2.wav"VOL_NORMATTN_NORM0PITCH_NORM)
        }
    }
    
    return 
PLUGIN_CONTINUE
}

public 
play_sound1(){
    
emit_sound(0CHAN_VOICE"fnm/welcome1.wav"VOL_NORMATTN_NORM0PITCH_NORM)
}

public 
play_sound2(){
    
emit_sound(0CHAN_VOICE"fnm/welcome2.wav"VOL_NORMATTN_NORM0PITCH_NORM)
}

public 
play_sound3(){
    
emit_sound(0CHAN_VOICE"fnm/leave1.wav"VOL_NORMATTN_NORM0PITCH_NORM)
}

public 
play_sound4(){
    
emit_sound(0CHAN_VOICE"fnm/leave2.wav"VOL_NORMATTN_NORM0PITCH_NORM)

__________________
MARREC/OWNED = me.
owned is offline
Old 07-26-2007, 17:45
organizedKaoS
This message has been deleted by organizedKaoS.
purple nurple
Senior Member
Join Date: Jun 2007
Location: US Missouri
Old 07-26-2007 , 18:09   Re: Plugin Not Reading
Reply With Quote #3

instead of using
Code:
emit_sound(0, CHAN_VOICE, "fnm/welcome1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
use
Code:
client_cmd(0,"spk sound/fnm/welcome.wav")
EDIT then everyone can hear the sound with emit_sound it comes from the person and if there dead after they connect it mite crash the server.
purple nurple 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 22:59.


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