Raised This Month: $ Target: $400
 0% 

Emit_sound error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Gian_Yagami
Member
Join Date: Apr 2014
Old 07-29-2014 , 01:22   Emit_sound error
Reply With Quote #1

I'd like to replace player noise if they use character Female, Here's my code:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "Sound replace"
#define VERSION "Testing"
#define AUTHOR "Gian_Yagami"
#define channel
#define fw_EmitSound


new const SOUND_F_BHIT[3][] = { "player/f_bhit_flesh-1.wav",
            
"player/f_bhit_flesh-2.wav",
            
"player/f_bhit_flesh-3.wav"}
new const 
SOUND_F_DIE[3][] = { "player/f_die1.wav",
            
"player/f_die2.wav",
            
"player/f_die3.wav"}
new const 
SOUND_F_HS[3][] = { "player/f_headshot1.wav",
            
"player/f_headshot2.wav",
            
"player/f_headshot3.wav"}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_forward(FM_EmitSound"fw_EmitSound")
}

public 
plugin_precache()
{
    for (new 
0<= 2i++)
    {
        
engfunc(EngFunc_PrecacheSoundSOUND_F_BHIT[i])
        
engfunc(EngFunc_PrecacheSoundSOUND_F_DIE[i])
        
engfunc(EngFunc_PrecacheSoundSOUND_F_HS[i])
    }

new 
model[32]

public 
fw_EmitSound(idchannel, const sample[], Float:volumeFloat:attnflagspitch)
{
    if (!
is_user_connected(id)){
        return 
FMRS_IGNORED;
    }
    
get_user_info(idmodel31)
    if(
equal(model"yuri")
    new 
sound[101]
    for (new 
0<= 2i++)
    {
        
// Hit
        
format(soundcharsmax(sound), "%s"SOUND_F_BHIT[i])
        
replace(soundcharsmax(sound), "player/f_""player/")
        if (
equal(samplesound))
        {
            
emit_sound(idchannelSOUND_F_BHIT[i], volumeattnflagspitch)
            return 
FMRES_SUPERCEDE;
        }
        
// Die
        
format(soundcharsmax(sound), "%s"SOUND_F_DIE[i])
        
replace(soundcharsmax(sound), "player/f_""player/")
        if (
equal(samplesound))
        {
            
emit_sound(idchannelSOUND_F_DIE[i], volumeattnflagspitch)
            return 
FMRES_SUPERCEDE;
        }
        
// Headshot
        
format(soundcharsmax(sound), "%s"SOUND_F_HS[i])
        
replace(soundcharsmax(sound), "player/f_""player/")
        if (
equal(samplesound))
        {
            
emit_sound(idchannelSOUND_F_HS[i], volumeattnflagspitch)
            return 
FMRES_SUPERCEDE;
        }
    }
    
    
//client_print(id, print_chat, "[%s]", sample)
    
return FMRES_IGNORED;

compile error message:
Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 41
Error: Invalid expression, assumed zero on line 43
Error: Undefined symbol "id" on line 43
Error: Invalid expression, assumed zero on line 43
Error: Too many error messages on one line on line 43

Compilation aborted.
4 Errors.
Could not locate output file C:\Users\Compaq\Desktop\woman_sounds.amx (compile failed).
Gian_Yagami is offline
 


Thread Tools
Display Modes

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 12:58.


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